Deploying JSPs
Problems deploying and/or shipping webapplications that include JSPs include:
- License restrictions on JDK (NB recently relaxed on javac).
- Security issues of a compiler on a production platform.
- Difficulties in setting portable classpaths for all platforms.
- Lack of compile time testing.
A common solution to these problems is to precompile the JSPs into servlets:
- Use the org.apache.jasper.JspC class to generate servlets and web.xml segment.
- Compile the generated servlets and place classes in WEB-INF/lib as a jar or in WEB-INF/classes.
- Update WEB-INF/web.xml with the servlet mappings.
- Jar the directory into a WAR file.
- Deploy the WAR file normally.
Return to JettyFaq