-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Support JSP with Embedded Jetty. #5290
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
Conversation
@tsachev Looks like executable jars work also (?). |
Did not tried that, but would be cool if so. |
@tsachev those changes look good to me from the jetty perspective. The only quibble I have is that the spring-dependencies contain both org.eclipse.jetty:apache-jsp and org.mortbay.jasper:apache-jsp, where the former already has the latter as a transitive dep. Is this because you want release 8.0.27 of org.mortbay.jasper:apache-jsp instead of 8.0.9? If so, I will see if I can get a jetty-9.2.16 release done so that you can remove the duplicate dependency and then spring-boot should be able to use this pull request. |
@janbartel Yeah I could not make it work with 8.0.9.M3. That's why I decided to fix this in spring boot dependencies until a version of jetty 9.2.x is released with jetty/jetty.project#371. |
@tsachev I've released jetty-9.2.16 so you can update your pull request and jsp should work with jetty in spring-boot. |
@janbartel Thanks, will do so. |
@janbartel I have updated the PR. |
@tsachev I've done the Jetty upgrade |
With this change it is now possible to create executable wars with embedded jetty. Fixes spring-projectsgh-367
* pr/5290: Support JSPs in Embedded Jetty
The JVM only allows URL.setURLStreamHandlerFactory to be called once. This is problematic as the JSP support in embedded Tomcat and embedded Jetty both call this method. This commit uses reflection to null out URL’s factory field before and after the embedded Jetty tests have run. This ensures that they can run successfully if Tomcat has already installed its factory and that Tomcat-related tests can also run afterwards. See gh-5290
@nyilmaz We know it doesn't work with jar packaging. In the section on JSP limitations, the documentation says:
The best approach is not to use JSPs. Failing that, war packaging will work. |
With this change it is now possible
to create executable wars with embedded jetty
that use Jsp.
I have also sample for jetty 9.3 to add, but it is blocked by #5287