JSP Precompilation / JSPC / JSP servlet mapping
Hi, I've set my Tomcat 4.1.24 installation to production mode, i.e. I've set 'development' to false, 'reloading' to true and 'fork' to true in CATALINA_HOME/conf/web.xml. I have some JSPs that are modified from time to time. My questions are: 1a. Why is the package name for java files generated from a JSP compilation different when using JSPC and when you let Jasper compile the JSP when you access it (especially for JSP in directories in a context)? 1b. Can you use JSPC to precompile JSPs into the work directory without having to wait till they are accessed or using something like UNIX's wget to 'touch' the file and force a compilation? 2. How exactly does Jasper precompile JSPs into the work directory? Can one write an Ant build file to precompile JSPs in a context to the work dir the same way Jasper does? 3. If you've precompiled your JSPs and mapped them in web.xml would Jasper precompile them and reload them if they are subsequently modified? 4. What are the advantages of mapping JSPs in web.xml as opposed to having Jasper compile them in the work directory? Zach. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation / JSPC / JSP servlet mapping
At 09:24 AM 7/18/2003, you wrote: Hi, I've set my Tomcat 4.1.24 installation to production mode, i.e. I've set 'development' to false, 'reloading' to true and 'fork' to true in CATALINA_HOME/conf/web.xml. If you're in production, reloading should be false (you don't want to poll for changed resources). I have some JSPs that are modified from time to time. My questions are: ... all answered many times. STFA for precompile or derivatives: http://marc.theaimsgroup.com/?l=tomcat-user RTFM under Web Application Compilation http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html If you still can't find the answers, post again and we'll clarify. justin 1a. Why is the package name for java files generated from a JSP compilation different when using JSPC and when you let Jasper compile the JSP when you access it (especially for JSP in directories in a context)? 1b. Can you use JSPC to precompile JSPs into the work directory without having to wait till they are accessed or using something like UNIX's wget to 'touch' the file and force a compilation? 2. How exactly does Jasper precompile JSPs into the work directory? Can one write an Ant build file to precompile JSPs in a context to the work dir the same way Jasper does? 3. If you've precompiled your JSPs and mapped them in web.xml would Jasper precompile them and reload them if they are subsequently modified? 4. What are the advantages of mapping JSPs in web.xml as opposed to having Jasper compile them in the work directory? Zach. Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation / JSPC / JSP servlet mapping
Then, the declarations and mappings for the servlets which were generated during the precompilation must be added to the web application deployment descriptor. Insert the ${webapp.path}/WEB-INF/generated_web.xml at the right place inside the ${webapp.path}/WEB-INF/web.xml file. Restart the web application (using the manager) and test it to verify it is running fine with precompiled servlets. An appropriate token placed in the web application deployment descriptor may also be used to automatically insert the generated servlet declarations and mappings using Ant filtering capabilities. This is actually how all the webapps distributed with Tomcat are automatically compiled as part of the build process. This is the part that is very unclear. Please explain the use of the webXmlFragment and how it can be used to place the mappings into a web.xml. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP Precompilation / JSPC / JSP servlet mapping
At 01:46 PM 7/18/2003, you wrote: ...An appropriate token placed in the web application deployment descriptor may also be used to automatically insert the generated servlet declarations and mappings using Ant filtering capabilities. This is actually how all the webapps distributed with Tomcat are automatically compiled as part of the build process. This is the part that is very unclear. Please explain the use of the webXmlFragment and how it can be used to place the mappings into a web.xml. See Ant's Filter task documentation. Basically, you take your web.xml as you have it (without any of the precompiled jsp information) and add a token like @jspServletXml where you want the fragment placed at. Then define a filter in your build xml (using jspServletXml and webXmlFragment) and copy your existing web.xml to a new location (with filtering=true) -- this replaces @jspServletXml with jasper2's generated xml. Disclaimer: I don't use this method because the Ant tasks don't do what I need it to do (I need to support builds with precompile for multiple appservers). Instead, I manually enter all information for our precompiled jsps in the web.xml and use a different script for running jspc. justin Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential See http://www.nextengine.com/confidentiality.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]