I would like to deploy the compiled jsp files rather then the jsp source. Can I precompile them and put them in a WAR file?

Alessandro A. Garbagnati

Theoretical you can, but how easy this task is is something that really depends on the Servlet Container you're using.

Basically, when you hit a JSP or you precompile it, the generated servlet source is put in a working repository (normalli is the 'work' directory). Then it's compiled to generate the servlet class and unless you change the page, that is what you hit when you request the jsp page.
This working repository is not part of the .war file, so you cannot just put it inside.

What you can do is manually (or with a script) compile all the JSP into servlet and work on the web application descriptor (web.xml) for mapping the jsp request to the right servlet. In that case the servlets will be put under WEB-INF/classes or WEB-INF/lib (if jarred) and you can then generate a full .war file.
It's a long and not easy process, but Tomcat contains somthing that does that for you (jspc) and you can take a look at it.

By the way... I've never done this complete test... Mine it's just a theoretical situation.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact