[ start | index | login ]
start > Development > Java & J2EE > Tomcat > jasper-prod

jasper-prod

Created by mpecher. Last edited by mpecher, 5 years and 168 days ago. Viewed 526 times. #1
[edit] [rdf]
labels
attachments

Tomcat JSP production configuration


More info at >>Tomcat JSP config
When using Jasper 2 in a production Tomcat server you should consider making the following changes from the default configuration.
  • development:To disable on access checks for JSP pages compilation set this to false.
  • genStringAsCharArray:To generate slightly more efficient char arrays, set this to true.
  • modificationTestInterval:If development has to be set to true for any reason (such as dynamic generation of JSPs), setting this to a high value will improve performance a lot.
  • trimSpaces:To remove useless bytes from the response, set this to true.
  • reloading:Should Jasper check for modified JSPs?
  • keepgenerated:Should we keep the generated Java source code for each page instead of deleting it
  • checkInterval:If development is false and reloading is true, background compiles are enabled. checkInterval is the time in seconds between checks to see if a JSP page needs to be recompiled. Default 300 seconds.
  • modificationTestInterval:Checks for modification for a given JSP file (and all its dependent files) will be performed only once every specified amount of seconds. Setting this to 0 will cause the JSP to be checked on every access. Default is 4 seconds.
This is all configured in tomcat's conf/web.xml which is applied to all web.xml files for all apps.
Modify in $TOMCAT_HOME/conf/web.xml:
<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>fork</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>development</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>genStringAsCharArray</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>trimSpaces</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>reloading</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>keepgenerated</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>checkInterval</param-name>
        <param-value>99999</param-value>
    </init-param>    
    <init-param>
        <param-name>modificationTestInterval</param-name>
        <param-value>99999</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>
no comments | post comment

Menu:
Java & J2EE
Development
Books

Help:
Help FAQ
Formatting


< February 2012 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
26272829


Logged in Users: (1)
… and 9 Guests.



Disclaimer: Views and opinions are that of the individual author, and not that of Marand Custom Solutions. This site is an open forum for technical content, and the company accepts no liability for any content or view expressed.