RE: Preload JSP when it's startup
One way would be to register the jsp/s in your web.xml and include the load-on-startup/ tag. Your entry in the web.xml would look as follows: servlet servlet-namestart/servlet-name jsp-filestart.jsp/jsp-file load-on-startup1/load-on-startup /servlet For the following jsp, the load-on-startup will be 2 etc. Kind Regards Schalk Neethling Web Developer.Designer.Programmer.CEO Volume4.Development.Multimedia.Branding emotionalize.conceptualize.visualize.realize Tel: +27125468436 Fax: +27125468436 email:[EMAIL PROTECTED] web: www.volume4.co.za This message contains information that is considered to be sensitive or confidential and may not be forwarded or disclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you. :: -Original Message- :: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] :: Sent: Friday, November 28, 2003 3:59 AM :: To: [EMAIL PROTECTED] :: Subject: Preload JSP when it's startup :: :: As we know, first time when JSP is called, it's complied into Servlet and :: the next time you call the same jsp, the respond time will be faster. :: :: Thus, anywar for Tomcat to set to preload the JSP page when it's starting :: up the server? :: :: Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Preload JSP when it's startup
I use the following Ant build file to precompile all jsps to work dir. I prepared this based on another post in this list. All the jsps are converted to java and then to class files. project name=myapp default=all basedir=E:\Tomcat4.1\work\Standalone\localhost\myapp !--Simple build file to compile all jsp files to java and javac to the work directory of tomcat installation -- property name=tomcat.home value=E:\Tomcat4.1/ property name=webapp.path value=E:\Projects\myapp/ !-- web application docBase in server.xml -- target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${tomcat.home}/server/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${webapp.path} webXmlFragment=${basedir}/generated_web.xml outputDir=${basedir} / /target target name=javac depends=jspc javac srcdir=${basedir} destdir=${basedir} optimize=off debug=on failonerror=false excludes=**/*.smap classpath pathelement location=${webapp.path}/WEB-INF/classes/ fileset dir=${webapp.path}/WEB-INF/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/common/classes/ fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/shared/classes/ fileset dir=${tomcat.home}/shared/lib include name=*.jar/ /fileset /classpath include name=** / exclude name=tags/** / /javac /target target name=all depends=jspc,javac /target /project Rgds Antony Paul. - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, November 28, 2003 12:25 PM Subject: Re: Preload JSP when it's startup Can you please tell me exact instruction? Script?? store it in where? how? Deepak Parbhoo [EMAIL PROTECTED] 11/28/2003 01:12 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Preload JSP when it's startup Write a script that calls the jsp's with '?jsp_precompile=true' as a parameter. So if the page is called start.jsp you will make a request to: http://server:port/start.jsp?jsp_precompile=true. [EMAIL PROTECTED] wrote: As we know, first time when JSP is called, it's complied into Servlet and the next time you call the same jsp, the respond time will be faster. Thus, anywar for Tomcat to set to preload the JSP page when it's starting up the server? Thanks. - 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: Preload JSP when it's startup
Here is the solution that worked for me: http://cvs.apache.org/~fhanik/precompile.html Antony Paul wrote: I use the following Ant build file to precompile all jsps to work dir. I prepared this based on another post in this list. All the jsps are converted to java and then to class files. project name=myapp default=all basedir=E:\Tomcat4.1\work\Standalone\localhost\myapp !--Simple build file to compile all jsp files to java and javac to the work directory of tomcat installation -- property name=tomcat.home value=E:\Tomcat4.1/ property name=webapp.path value=E:\Projects\myapp/ !-- web application docBase in server.xml -- target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${tomcat.home}/server/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${webapp.path} webXmlFragment=${basedir}/generated_web.xml outputDir=${basedir} / /target target name=javac depends=jspc javac srcdir=${basedir} destdir=${basedir} optimize=off debug=on failonerror=false excludes=**/*.smap classpath pathelement location=${webapp.path}/WEB-INF/classes/ fileset dir=${webapp.path}/WEB-INF/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/common/classes/ fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/shared/classes/ fileset dir=${tomcat.home}/shared/lib include name=*.jar/ /fileset /classpath include name=** / exclude name=tags/** / /javac /target target name=all depends=jspc,javac /target /project Rgds Antony Paul. - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, November 28, 2003 12:25 PM Subject: Re: Preload JSP when it's startup Can you please tell me exact instruction? Script?? store it in where? how? Deepak Parbhoo [EMAIL PROTECTED] 11/28/2003 01:12 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Preload JSP when it's startup Write a script that calls the jsp's with '?jsp_precompile=true' as a parameter. So if the page is called start.jsp you will make a request to: http://server:port/start.jsp?jsp_precompile=true. [EMAIL PROTECTED] wrote: As we know, first time when JSP is called, it's complied into Servlet and the next time you call the same jsp, the respond time will be faster. Thus, anywar for Tomcat to set to preload the JSP page when it's starting up the server? Thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Preload JSP when it's startup
I use the following Ant build file to precompile all jsps to work dir. I prepared this based on another post in this list. All the jsps are converted to java and then to class files. project name=myapp default=all basedir=E:\Tomcat4.1\work\Standalone\localhost\myapp !--Simple build file to compile all jsp files to java and javac to the work directory of tomcat installation -- property name=tomcat.home value=E:\Tomcat4.1/ property name=webapp.path value=E:\Projects\myapp/ !-- web application docBase in server.xml -- target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${tomcat.home}/server/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${webapp.path} webXmlFragment=${basedir}/generated_web.xml outputDir=${basedir} / /target target name=javac depends=jspc javac srcdir=${basedir} destdir=${basedir} optimize=off debug=on failonerror=false excludes=**/*.smap classpath pathelement location=${webapp.path}/WEB-INF/classes/ fileset dir=${webapp.path}/WEB-INF/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/common/classes/ fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/shared/classes/ fileset dir=${tomcat.home}/shared/lib include name=*.jar/ /fileset /classpath include name=** / exclude name=tags/** / /javac /target target name=all depends=jspc,javac /target /project Rgds Antony Paul. - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, November 28, 2003 12:25 PM Subject: Re: Preload JSP when it's startup Can you please tell me exact instruction? Script?? store it in where? how? Deepak Parbhoo [EMAIL PROTECTED] 11/28/2003 01:12 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Preload JSP when it's startup Write a script that calls the jsp's with '?jsp_precompile=true' as a parameter. So if the page is called start.jsp you will make a request to: http://server:port/start.jsp?jsp_precompile=true. [EMAIL PROTECTED] wrote: As we know, first time when JSP is called, it's complied into Servlet and the next time you call the same jsp, the respond time will be faster. Thus, anywar for Tomcat to set to preload the JSP page when it's starting up the server? Thanks. - 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: Preload JSP when it's startup
Write a script that calls the jsp's with '?jsp_precompile=true' as a parameter. So if the page is called start.jsp you will make a request to: http://server:port/start.jsp?jsp_precompile=true. [EMAIL PROTECTED] wrote: As we know, first time when JSP is called, it's complied into Servlet and the next time you call the same jsp, the respond time will be faster. Thus, anywar for Tomcat to set to preload the JSP page when it's starting up the server? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Preload JSP when it's startup
Can you please tell me exact instruction? Script?? store it in where? how? Deepak Parbhoo [EMAIL PROTECTED] 11/28/2003 01:12 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Preload JSP when it's startup Write a script that calls the jsp's with '?jsp_precompile=true' as a parameter. So if the page is called start.jsp you will make a request to: http://server:port/start.jsp?jsp_precompile=true. [EMAIL PROTECTED] wrote: As we know, first time when JSP is called, it's complied into Servlet and the next time you call the same jsp, the respond time will be faster. Thus, anywar for Tomcat to set to preload the JSP page when it's starting up the server? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]