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.
views:
729answers:
2
A:
It is dumped already.
for example if you have a file called index.jsp
, a file will be created called index_jsp.java
Just search for something like that in the work directory.
Javaxpert
2008-09-18 12:48:16
Hmm, there are some ${page}_jsp.java files around but they don't seem to update when I change the related jsp page even though the results show up straight away on the browser.
stsquad
2008-09-26 11:16:34
+2
A:
If you are using Jetty 6 you can use the following code:
String webApp = "./web/myapp"; // Location of the jsp files
String contextPath = "/myapp";
WebAppContext webAppContext = new WebAppContext(webApp, contextPath);
ServletHandler servletHandler = webAppContext.getServletHandler();
ServletHolder holder = new ServletHolder(JspServlet.class);
servletHandler.addServletWithMapping(holder, "*.jsp");
holder.setInitOrder(0);
holder.setInitParameter("compiler", "modern");
holder.setInitParameter("fork", "false");
File dir = new File("./web/compiled/" + webApp);
dir.mkdirs();
holder.setInitParameter("scratchdir", dir.getAbsolutePath());
Roel Spilker
2008-09-18 12:51:25