-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetty.xml Rewrite Handler doesnt seem to take effect. #101
Comments
Hi Dave, |
Hi, Thanks for the speedy reply! Created an example project with a pom, build.gradle, index html and one rule in jetty.xml that should redirect from "localhost:8080/summary" > "localhost:8080/". Running "JettyRun" Maven plugin goal exhibits correct behaviour, running "JettyStart" gradle task loads container and root page etc but doesn't reroute correctly. https://github.com/daves125125/LocationList/tree/master/RewriteHandlerExample |
I cloned the project and tried maven and gradle runs - the problem is well-reproducible, thank you.
|
Ok great, ill make the change and then check out the snapshot on Tuesday. Thanks. |
Snapshot comes in 20 minutes 😄 It's release that comes on Tuesday. |
Snapshot with the fix is ready and available at jfrog snapshot repository. You can use it via code: apply from: 'https://raw.githubusercontent.com/akhikhl/gretty/master/pluginScripts/gretty-SNAPSHOT.plugin' or feel free copying code from that file (gretty-SNAPSHOT.plugin). |
Hey, Ive applied the latest snapshot and amended the gradle.build i.e: apply plugin: 'war'
//apply plugin: 'org.akhikhl.gretty'
apply from: 'https://raw.githubusercontent.com/akhikhl/gretty/master/pluginScripts/gretty-SNAPSHOT.plugin'
project.group = 'com.foo.bar'
project.version = '0.0.1-SNAPSHOT'
project.webAppDirName = "app"
gretty {
contextPath = "/"
servletContainer = 'jetty7'
serverConfigFile = 'jetty.xml'
}
dependencies {
gretty 'org.eclipse.jetty:jetty-rewrite:7.6.15.v20140411'
}
repositories {
mavenCentral()
}
//buildscript {
// dependencies {
// classpath 'org.akhikhl.gretty:gretty:+'
// }
//
// repositories {
// mavenCentral()
// jcenter()
// }
//}
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
} And unfortunately it still doesn't seem to be taking effect for me, not sure if im missing some other configuration. Additionally a definition of a connector seems to become a duplication, for example setting the following connector in jetty.xml will result in "Address in use" as gretty also creates a default one (maybe this is intended behaviour): <Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.bio.SocketConnector">
<Set name="port">8080</Set>
</New>
</Arg>
</Call> I've committed and pushed the above to the previous example project if that helps in testing. Cheers |
I'll have a look. |
New fix is in snapshot repository. Could you, please, test RewriteHandlerExample again? |
Works great, thank you very much! |
I'm happy that it works for you, Dave 😄 |
I have to delay Gretty Release 1.1.5 to the end of this week because of other urgent things that people wait to be released. |
Gretty release 1.1.6 is out, with the abovementioned fix. |
Thanks! Using now and it works great. |
My project using Dropwizard framework which inbuilt uses jetty server 8.1.10 maven dependency for running application. |
Im trying to configure a rewrite handler for Jetty (to facilitate redirecting when requesting AngularJs route provider locations without hash tags).
I have the equivalent configuration for jetty-maven-plugin and gretty plugin, and it seems to work perfectly with the maven plugin (inspired by http://stackoverflow.com/questions/4681907/how-do-i-configuration-to-use-rewrite-by-jetty-maven-plugin) but it doesn't seem to take effect when using gretty. No exceptions or warnings are thrown, tried with a few versions Jetty7 - 9 with the same results seen.
The jetty.xml used is as follows:
The gradle configuration used is:
And the (Much more ugly) Maven Configuration:
Thanks,
Dave.
The text was updated successfully, but these errors were encountered: