[ Team LiB ] |
Recipe 5.3 Precompiling JSPs with the Precompilation ProtocolProblemYou want to use the "precompilation protocol" that is part of the JSP specification to precompile one or more JSP files. SolutionSend a request to the JSP container that includes a jsp_precompile parameter. DiscussionThe JSP 1.2 and 2.0 specifications require compliant JSP containers to support the use of the jsp_precompile request parameter. This parameter suggests that the container precompile the requested JSP. Here is how it works in Tomcat:
This protocol is best used with an automated tool that can make HTTP requests, such as the Jakarta Commons HttpClient component. Using such a tool allows you to automate the precompilation of dozens of JSPs by sending several HTTP requests from a single Java program. See AlsoRecipe 5.1 on using Tomcat's JspC utility; Recipe 5.2 on precompiling with WebLogic Server; Recipe 5.4 on mapping the compiled JSPs in web.xml; Chapter 7 on sending HTTP requests from a servlet or a JSP; the Jakarta Commons HttpClient homepage at http://jakarta.apache.org/commons/httpclient/; The JSP precompilation section of JavaServer Pages by Hans Bergsten (O'Reilly); Chapter JSP.11.4 of the JSP 2.0 specification. |
[ Team LiB ] |