I keep running into this problem when debugging JSP pages in OpenNMS. The Jetty wiki talks about keepGenerated (http://docs.codehaus.org/display/JETTY/KeepGenerated) in webdefault.xml but it seems unclear how this works in embedded setups.
I know this is ages old, but I haven't found the answer anywhere else on the internet and it doesn't seem as though this has gotten any easier. Hopefully this will help someone:
extract your webdefault.xml from the jetty-version.jar, mine was in :C:\Documents and Settings\JB.m2\repository\org\mortbay\jetty\jetty\6.1.22\jetty-6.1.22.jar inside the org/mortbay/jetty/webapp/webdefault.xml file
Put the webdefault.xml into my project directory
Edit the webdefault.xml and add the following line:
<servlet id="jsp">
....
<init-param>
<param-name>keepgenerated</param-name>
<param-value>true</param-value>
</init-param>
Add the following into your maven pom.xml config:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<webDefaultXml>webdefault.xml</webDefaultXml>
</configuration>
</plugin>
When you run the mvn jetty:run
maven goal my jsp code is now kept in target\work\jsp\org\apache\jsp\WEB_002dINF\jsp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With