Jetty embedded and JSP compilation to 1.7?

2019-05-07 14:01发布

问题:

Could i specify somehow the target version of vm for jsp compilation? (I need 1.7, not 1.5 which is by default).
I have a WebAppContext, some filters in code on it etc. The webapp itself is an exploded war.. so no xml configuration is used as it was not needed.

But seems, xml configuration are strictly necessary in order to do this?
How it shall look like (and wouldn't it conflict with the in-code definitions) ?
..or is there any way to do the trick through the code? Thanks.

回答1:

http://www.eclipse.org/jetty/documentation/current/configuring-jsp.html#jsp-support

When you are configuring the org.apache.jasper.JspServlet, there is an option for compilerTargetVM which lets you set this value.

[edit] I'll add that you may want to look into the webdefault.xml file in jetty and poach the JspServlet definition there into your own web.xml and make your changes accordingly.

http://www.eclipse.org/jetty/documentation/current/webdefault-xml.html