The JettyJspServlet
supports the same init-params as Tomcat's JspServlet
.
The mappedfile
init-param is there (just set it to something invalid like "foo" and watch the error message pop out "Warning: Invalid value for the initParam mappedFile. Will use the default value of "false"")
You'll need to reference the existing JSP servlet and add those init-parameters to your WEB-INF/web.xml
.
<servlet id="jsp">
<servlet-name>jsp</servlet-name>
<init-param>
<param-name>mappedfile</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
Or create a new webdefault.xml
with this parameter and have your webapp use it with the XML deployables in ${jetty.base}/webapps/${webappid}.xml
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/foo</Set>
<Set name="war"><Property name="jetty.webapps"/>/foobar.war</Set>
<Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/mywebdefault.xml</Set>
</Configure>
The "mappedfile" init-param:
It appears to switch from generating normal print statements in the intermediate *.java file to 1 liner print statements.
This means you are at the razors edge of JavaC support in your JSP file. There are many hard limits to the size of the *.java file on javac, and your JSP file is tickling those limits now.
Some (but not all) javac limits:
- Static Initializers Size: 65535 bytes max.
- Method or Constructor Length: 65535 bytes max. (the one your JSP file is tripping on)
- Method or Constructor Parameter Length: 255 parameters max.
- Local Variables Size: 65535 bytes max.
- Synthetic Parameters Length: 255 parameters max.
- Array Dimensions: 255 max.
If this init-param works for you, then use it.
But if you need to maintain / edit that JSP file, know that you can almost certainly not add to it (only remove).
You'll likely have to refactor it into smaller pieces with imports in the future.