%@ include % files and Jasper/Ant
I'm trying to use Ant (in stand-alone fashion) to build a set of JSPs. The JSPs compile, execute and serve up HTML fine when compiled under Tomcat 5.0.25; only the root JSPs generate .java files. Eg. FileA.jsp contains a %@ include=FileB.jsp % directive. When requested through the Tomcat web server, only FileA_jsp.java and FileA_jsp.class are created. However, when I run Ant (or JspC) from the command line (using the sample from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html#Web Application Compilation for build.xml), it creates both FileA_jsp.java and FileB_jsp.java. The build then fails because FileB_jsp.java's compilation, by itself fails without having the context of being code included in FileA. How do Jasper/Ant running behind the scenes under the Tomcat webserver know not to emit and compile the dependent files? And why would Jasper/Ant running standalone (I'm using Ant 1.6.1 as-is from the .ZIP distribution) NOT produce same output? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: %@ include % files and Jasper/Ant
This is an ant script I wrote to precompile JSPs for tomcat, the benefit of this script, vs the regular precompile, is that is compiles files into the tomcat work folder, so there are no additions needed in web.xml and you can reload JSP files, and at the same time have the benefit of precompiled performance. http://cvs.apache.org/~fhanik/precompile.html we have tons of include statements and they work fine. Not that this answers your question, but it may give you a better alternative Filip - Original Message - From: Robert Hunt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 08, 2004 2:27 PM Subject: %@ include % files and Jasper/Ant I'm trying to use Ant (in stand-alone fashion) to build a set of JSPs. The JSPs compile, execute and serve up HTML fine when compiled under Tomcat 5.0.25; only the root JSPs generate .java files. Eg. FileA.jsp contains a %@ include=FileB.jsp % directive. When requested through the Tomcat web server, only FileA_jsp.java and FileA_jsp.class are created. However, when I run Ant (or JspC) from the command line (using the sample from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html#Web Application Compilation for build.xml), it creates both FileA_jsp.java and FileB_jsp.java. The build then fails because FileB_jsp.java's compilation, by itself fails without having the context of being code included in FileA. How do Jasper/Ant running behind the scenes under the Tomcat webserver know not to emit and compile the dependent files? And why would Jasper/Ant running standalone (I'm using Ant 1.6.1 as-is from the .ZIP distribution) NOT produce same output? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: %@ include % files and Jasper/Ant
Thanks for the reply Filip, but no, that doesn't answer the question nor does it solve the issue; the emitted dependent files still trigger compilation problems. However, I *do* like how your tomcat-precompile-jsp.xml handily precompiles JSPs as Tomcat would. Very nice. So, the question remains: How do Jasper/Ant running behind the scenes under the Tomcat webserver know *NOT* to emit (and thus compile) the dependent files? And why would Jasper/Ant running standalone (I'm using Ant 1.6.1 as-is from the .ZIP distribution) NOT produce same output? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: %@ include % files and Jasper/Ant
Tomcat compiles pages as needed. So if someone hits File.jsp, the FileA_jsp.java file is created and compiled. If you were to hit FileB.jsp, Tomcat would try to compile it and get the compile errors. Your ant job is no doubt trying to compile all the .jsp files, causing your compile errors. Try giving FileB.jsp a different extension. Layton -Original Message- From: Robert Hunt [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 11:28 AM To: [EMAIL PROTECTED] Subject: %@ include % files and Jasper/Ant Importance: High I'm trying to use Ant (in stand-alone fashion) to build a set of JSPs. The JSPs compile, execute and serve up HTML fine when compiled under Tomcat 5.0.25; only the root JSPs generate .java files. Eg. FileA.jsp contains a %@ include=FileB.jsp % directive. When requested through the Tomcat web server, only FileA_jsp.java and FileA_jsp.class are created. However, when I run Ant (or JspC) from the command line (using the sample from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html#Web Application Compilation for build.xml), it creates both FileA_jsp.java and FileB_jsp.java. The build then fails because FileB_jsp.java's compilation, by itself fails without having the context of being code included in FileA. How do Jasper/Ant running behind the scenes under the Tomcat webserver know not to emit and compile the dependent files? And why would Jasper/Ant running standalone (I'm using Ant 1.6.1 as-is from the .ZIP distribution) NOT produce same output? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: %@ include % files and Jasper/Ant
Thanks Layton. Makes sense. Looking back now, when I read the Jasper How-to page (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html) the implication (at least, how I comprehended it) was that Jasper would produce the same output including the seemingly prescient ability of compiling only what's needed. I'll change the extensions or place them in a subdir (adding the appropriate exclusions to the build xml). Now, if only someone would pay attention to Classloader behavior in 5.0.25 5.0.16 (104699) -- RH From: Berry, Layton Tomcat compiles pages as needed. So if someone hits File.jsp, the FileA_jsp.java file is created and compiled. If you were to hit FileB.jsp, Tomcat would try to compile it and get the compile errors. Your ant job is no doubt trying to compile all the .jsp files, causing your compile errors. Try giving FileB.jsp a different extension. Layton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: %@ include % files and Jasper/Ant
Filip Hanik - Dev wrote: This is an ant script I wrote to precompile JSPs for tomcat, http://cvs.apache.org/~fhanik/precompile.html I have an ant script very similar to this but it does not report JSP errors in the same way as when compiled under tomcat. Is there any way to get jasper to report errors when used in standalone mode? Cheers, -- simon colston - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]