There is a tool jspc that come with the TC 4.X server that can be used to create servlet source for you JSPs. These sources can in turn be compiled into .class files. At the same time the jspc tool can create a web.inc file that contains all the new servlet mappings. This can be joined with the web.xml file in the WEB-INF directory so that the servlets will be mapped to the jsp urls. My understanding is that these mappings take precedence and redirect using the web.xml entries so the jsp source is never used.
I am currently trying to get this to work. I will re-post my problem below and maybe???? someone will give us some feedback. Once I get this working, I will gladly write up the process and submit it back to the project as documentation. REPOST: I am trying to pre-compile my jsp using jspc.bat on win2K. The reason I want to do this is so that JSP code can't be changed on the fly in production. I am using TC4.0.3. Here is how I try to do this from an ANT build script: <!-- JSPC: pre-compile JSPs --> <target name="jspc" depends="init"> <java fork="yes" classname="org.apache.jasper.JspC"> <arg line="-uriroot d:/jboss/tomcat/webapps/smartjobs -d d:/jboss/tomcat/webapps/smartjobs/WEB-INF/classes -p jsp -webinc d:/jboss/tomcat/webapps/smartjobs/WEB-INF/web.inc -webapp d:/jboss/tomcat/webapps/smartjobs" /> </java> </target> *********NOTE********** This has the same net result as doing this: cd %CATALINA_HOME%\bin jspc.bat -uri d:/jboss/tomcat/webapps/smartjobs -d d:/jboss/tomcat/webapps/smartjob/WEB-INF/classes -p jsp -webinc d:/jboss/tomcat/webapps/smartjobs/WEB-INF/web.inc -webapp d:/jboss/tomcat/webapps/smartjobs *********************** This does build all of the .java files in d:/jboss/tomcat/webapps/smartjobs/WEB-INF/classes/jsp, but the package name in them is actually as follows: package jsp.; It is the dot that is being appended to the end of the package name. This same dot has found its way into the web.inc file as well. <servlet> <servlet-name>jsp..index</servlet-name> <servlet-class>jsp..index</servlet-class> </servlet> <servlet-mapping> <servlet-name>jsp..index</servlet-name> <url-pattern>/index.jsp</url-pattern> </servlet-mapping> I went and looked at the CommandLineContext class and saw that getFullClassName() seems to append a . for some reason. Anyway, has anyone else run into this?? I there something obvious that I am doing wrong? Is more info needed before someone can help me? Thanks in advance! --Jay Gardner -----Original Message----- From: Christophe Reynaud [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 11:35 AM To: Tomcat Users List Subject: How to pre-compile JSP's ? Do you know if there is a simple solution to pre-compile the JSP's ? (And to tell tomcat not to re-compile the JSP's ?) Thanks Jay Gardner wrote: > There are definitely memory leaks in javac. This is a problem when jspc > compiles your jsp code in the same JVM as the TC server. > > --Jay Gardner > > -----Original Message----- > From: Christophe Reynaud [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 09, 2002 12:52 PM > To: Tomcat Users List > Subject: Tomcat process takes 246M whereas total java heap is 127M > > Hello, > > We use tomcat 3.3.1 on Linux RH 7.2. JVM : IBM 1.3 > > "top -c" tells that the tomcat threads take 246M but if we use the Java > function "totalMemory()", it tells that the JVM uses 127M for the heap. > Where is the rest of memory ? I expected that the JVM used more than > only the total of the heap, but in this case it is almost the double ! > Any ideas about the reasons of this problem ? Are there some momory > leaks in the JVM ? > > Thanks. > > Christophe > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]> -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>