-
Notifications
You must be signed in to change notification settings - Fork 45
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
How to enable jsp support of the jetty server? #140
Comments
@timur87 I haven't worked with JSP in a while. Can you elaborate on your use case? If you have a WAR file that contains JSP code, then you should be able to use |
@cprice404 , I have a war package from a third-party and this application uses JSP to generate the front-end. At the start up of the application I receive the following error: 2016-04-06 17:09:41,736 INFO [o.e.j.w.StandardDescriptorProcessor] NO JSP Support for /my-app, did not find org.eclipse.jetty.jsp.JettyJspServlet I found these: |
@timur87 at first glance, that error sounds like you don't have the Jetty JSP extensions on the classpath. I went to maven central to search for that classname to see what packages it is included in: http://search.maven.org/#search|ga|1|fc%3A%22org.eclipse.jetty.jsp.JettyJspServlet%22 So it looks to me like you might just need to edit your
You'll want to be careful to make sure that the version number there matches the version of jetty that is used in the version of If you add that dependency to your |
Hi, Thanks for the tip. I added the dependency as suggested and it helped a little bit, I can now deploy it w/o any exceptions but still it still does not work :) I get the following exception, when I try to request a page any further ideas?:
|
Hmmm. No, without any recent JSP experience, what I would do next would be to load up the Jetty source code and see where those stack traces were coming from, in hopes that it would highlight some configuration parameter that is not being set or something like that. |
So I had a chance to check again some examples regarding this issue. I found the listed [1-4] references. And from the official eclipse docs:
The example resides here https://www.eclipse.org/jetty/documentation/9.4.x/embedded-examples.html#embedded-webapp-jsp To enable the annotations they execute the following methods: // This webapp will use jsps and jstl. We need to enable the
// AnnotationConfiguration in order to correctly
// set up the jsp container
Configuration.ClassList classlist = Configuration.ClassList
.setServerDefault( server );
classlist.addBefore(
"org.eclipse.jetty.webapp.JettyWebXmlConfiguration",
"org.eclipse.jetty.annotations.AnnotationConfiguration" );
// Set the ContainerIncludeJarPattern so that jetty examines these
// container-path jars for tlds, web-fragments etc.
// If you omit the jar that contains the jstl .tlds, the jsp engine will
// scan for them instead.
webapp.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$" );
// A WebAppContext is a ContextHandler as well so it needs to be set to
// the server so it is aware of where to
// send the appropriate requests. Is it possible to enable this in your case? [1] https://github.com/jetty-project/embedded-jetty-jsp |
Hi @timur87 . Based on that example code, it looks like in order to support this we'd need to add a new function to our service protocol that allowed modifying the classlist configuration. Or, alternately, we could have a function that was something like "enable-annotation-configuration", and have that function make the change to the classlist. Not 100% sure which is better. After that it would be a matter of seeing whether the WebAppContext could be passed in to one of our registration methods (the ones to add a servlet / WAR handler). If so, then I think everything would work. We would probably be open to some changes along those lines, but I'm not sure it's something that would be likely to land on our roadmap any time very soon. If you were interested in looking into submitting a PR, we could definitely help with tips and guidance along the way. Thanks! |
Hi,
How can we enable the jsp support of the jetty server any ideas?
The text was updated successfully, but these errors were encountered: