blob: 1fb368f7bbe564c80ccd801b354241a8ffe5e956 [file] [log] [blame]
Cheng Tang07b30872014-04-27 16:37:18 +08001<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Apache Tomcat 7 (7.0.42) - Jasper 2 JSP Engine How To</title><meta name="author" content="Glenn L. Nielsen"><meta name="author" content="Peter Rossbach"><style type="text/css" media="print">
2 .noPrint {display: none;}
3 td#mainBody {width: 100%;}
4 </style><style type="text/css">
5 code {background-color:rgb(224,255,255);padding:0 0.1em;}
6 code.attributeName, code.propertyName {background-color:transparent;}
7 </style><style type="text/css">
8 .wrapped-source code { display: block; background-color: transparent; }
9 .wrapped-source div { margin: 0 0 0 1.25em; }
10 .wrapped-source p { margin: 0 0 0 1.25em; text-indent: -1.25em; }
11 </style><style type="text/css">
12 p.notice {
13 border: 1px solid rgb(255, 0, 0);
14 background-color: rgb(238, 238, 238);
15 color: rgb(0, 51, 102);
16 padding: 0.5em;
17 margin: 1em 2em 1em 1em;
18 }
19 </style></head><body bgcolor="#ffffff" text="#000000" link="#525D76" alink="#525D76" vlink="#525D76"><table border="0" width="100%" cellspacing="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img src="./images/tomcat.gif" align="right" alt="
20 The Apache Tomcat Servlet/JSP Container
21 " border="0"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 7</font></h1><font face="arial,helvetica,sanserif">Version 7.0.42, Jul 2 2013</font></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img src="./images/asf-logo.gif" align="right" alt="Apache Logo" border="0"></a></td></tr></table><table border="0" width="100%" cellspacing="4"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><tr><!--LEFT SIDE NAVIGATION--><td width="20%" valign="top" nowrap class="noPrint"><p><strong>Links</strong></p><ul><li><a href="index.html">Docs Home</a></li><li><a href="http://wiki.apache.org/tomcat/FAQ">FAQ</a></li><li><a href="#comments_section">User Comments</a></li></ul><p><strong>User Guide</strong></p><ul><li><a href="introduction.html">1) Introduction</a></li><li><a href="setup.html">2) Setup</a></li><li><a href="appdev/index.html">3) First webapp</a></li><li><a href="deployer-howto.html">4) Deployer</a></li><li><a href="manager-howto.html">5) Manager</a></li><li><a href="realm-howto.html">6) Realms and AAA</a></li><li><a href="security-manager-howto.html">7) Security Manager</a></li><li><a href="jndi-resources-howto.html">8) JNDI Resources</a></li><li><a href="jndi-datasource-examples-howto.html">9) JDBC DataSources</a></li><li><a href="class-loader-howto.html">10) Classloading</a></li><li><a href="jasper-howto.html">11) JSPs</a></li><li><a href="ssl-howto.html">12) SSL</a></li><li><a href="ssi-howto.html">13) SSI</a></li><li><a href="cgi-howto.html">14) CGI</a></li><li><a href="proxy-howto.html">15) Proxy Support</a></li><li><a href="mbeans-descriptor-howto.html">16) MBean Descriptor</a></li><li><a href="default-servlet.html">17) Default Servlet</a></li><li><a href="cluster-howto.html">18) Clustering</a></li><li><a href="balancer-howto.html">19) Load Balancer</a></li><li><a href="connectors.html">20) Connectors</a></li><li><a href="monitoring.html">21) Monitoring and Management</a></li><li><a href="logging.html">22) Logging</a></li><li><a href="apr.html">23) APR/Native</a></li><li><a href="virtual-hosting-howto.html">24) Virtual Hosting</a></li><li><a href="aio.html">25) Advanced IO</a></li><li><a href="extras.html">26) Additional Components</a></li><li><a href="maven-jars.html">27) Mavenized</a></li><li><a href="security-howto.html">28) Security Considerations</a></li><li><a href="windows-service-howto.html">29) Windows Service</a></li><li><a href="windows-auth-howto.html">30) Windows Authentication</a></li><li><a href="jdbc-pool.html">31) Tomcat's JDBC Pool</a></li><li><a href="web-socket-howto.html">32) WebSocket</a></li></ul><p><strong>Reference</strong></p><ul><li><a href="RELEASE-NOTES.txt">Release Notes</a></li><li><a href="config/index.html">Configuration</a></li><li><a href="api/index.html">Tomcat Javadocs</a></li><li><a href="servletapi/index.html">Servlet Javadocs</a></li><li><a href="jspapi/index.html">JSP 2.2 Javadocs</a></li><li><a href="elapi/index.html">EL 2.2 Javadocs</a></li><li><a href="http://tomcat.apache.org/connectors-doc/">JK 1.2 Documentation</a></li></ul><p><strong>Apache Tomcat Development</strong></p><ul><li><a href="building.html">Building</a></li><li><a href="changelog.html">Changelog</a></li><li><a href="http://wiki.apache.org/tomcat/TomcatVersions">Status</a></li><li><a href="developers.html">Developers</a></li><li><a href="architecture/index.html">Architecture</a></li><li><a href="funcspecs/index.html">Functional Specs.</a></li><li><a href="tribes/introduction.html">Tribes</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td width="80%" valign="top" align="left" id="mainBody"><h1>Jasper 2 JSP Engine How To</h1><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote>
22<ul><li><a href="#Introduction">Introduction</a></li><li><a href="#Configuration">Configuration</a></li><li><a href="#Known_issues">Known issues</a></li><li><a href="#Production_Configuration">Production Configuration</a></li><li><a href="#Web_Application_Compilation">Web Application Compilation</a></li><li><a href="#Optimisation">Optimisation</a></li></ul>
23</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Introduction"><strong>Introduction</strong></a></font></td></tr><tr><td><blockquote>
24
25<p>Tomcat 7.0 uses the Jasper 2 JSP Engine to implement
26the <a href="http://wiki.apache.org/tomcat/Specifications">JavaServer Pages 2.2</a>
27specification.</p>
28
29<p>Jasper 2 has been redesigned to significantly improve performance over
30the original Jasper. In addition to general code improvements the following
31changes were made:
32<ul>
33<li><strong>JSP Custom Tag Pooling</strong> - The java objects instantiated
34for JSP Custom Tags can now be pooled and reused. This significantly boosts
35the performance of JSP pages which use custom tags.</li>
36<li><strong>Background JSP compilation</strong> - If you make a change to
37a JSP page which had already been compiled Jasper 2 can recompile that
38page in the background. The previously compiled JSP page will still be
39available to serve requests. Once the new page has been compiled
40successfully it will replace the old page. This helps improve availability
41of your JSP pages on a production server.</li>
42<li><strong>Recompile JSP when included page changes</strong> - Jasper 2
43can now detect when a page included at compile time from a JSP has changed
44and then recompile the parent JSP.</li>
45<li><strong>JDT used to compile JSP pages</strong> - The
46Eclipse JDT Java compiler is now used to perform JSP java source code
47compilation. This compiler loads source dependencies from the container
48classloader. Ant and javac can still be used.</li>
49</ul>
50</p>
51
52<p>Jasper is implemented using the servlet class
53<code>org.apache.jasper.servlet.JspServlet</code>.</p>
54
55</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Configuration"><strong>Configuration</strong></a></font></td></tr><tr><td><blockquote>
56
57<p>By default Jasper is configured for use when doing web application
58development. See the section <a href="#Production Configuration">
59Production Configuration</a> for information on configuring Jasper
60for use on a production Tomcat server.</p>
61
62<p>The servlet which implements Jasper is configured using init parameters
63in your global <code>$CATALINA_BASE/conf/web.xml</code>.
64
65<ul>
66<li><strong>checkInterval</strong> - If development is false and checkInterval
67is greater than zero, background compiles are enabled. checkInterval is the time
68in seconds between checks to see if a JSP page (and its dependent files) needs
69to be recompiled. Default <code>0</code> seconds.</li>
70
71<li><strong>classdebuginfo</strong> - Should the class file be compiled with
72debugging information? <code>true</code> or <code>false</code>, default
73<code>true</code>.
74</li>
75
76<li><strong>classpath</strong> - Defines the class path to be used to compile
77the generated servlets. This parameter only has an effect if the ServletContext
78attribute org.apache.jasper.Constants.SERVLET_CLASSPATH is not set. This
79attribute is always set when Jasper is used within Tomcat. By default the
80classpath is created dynamically based on the current web application.</li>
81
82<li><strong>compiler</strong> - Which compiler Ant should use to compile JSP
83pages. The valid values for this are the same as for the compiler attribute of
84Ant's
85<a href="http://ant.apache.org/manual/Tasks/javac.html#compilervalues">javac</a>
86task. If the value is not set, then the default Eclipse JDT Java compiler will
87be used instead of using Ant. There is no default value. If this attribute is
88set then <code>setenv.[sh|bat]</code> should be used to add
89<code>ant.jar</code>, <code>ant-launcher.jar</code> and <code>tools.jar</code>
90to the <code>CLASSPATH</code> environment variable.</li>
91
92<li><strong>compilerSourceVM</strong> - What JDK version are the source files
93compatible with? (Default value: <code>1.6</code>)</li>
94
95<li><strong>compilerTargetVM</strong> - What JDK version are the generated files
96compatible with? (Default value: <code>1.6</code>)</li>
97
98<li><strong>development</strong> - Is Jasper used in development mode? If true,
99the frequency at which JSPs are checked for modification may be specified via
100the modificationTestInterval parameter.<code>true</code> or <code>false</code>,
101default <code>true</code>.</li>
102
103<li><strong>displaySourceFragment</strong> - Should a source fragment be
104included in exception messages? <code>true</code> or <code>false</code>,
105default <code>true</code>.</li>
106
107<li><strong>dumpSmap</strong> - Should the SMAP info for JSR45 debugging be
108dumped to a file? <code>true</code> or <code>false</code>, default
109<code>false</code>. <code>false</code> if suppressSmap is true.</li>
110
111<li><strong>enablePooling</strong> - Determines whether tag handler pooling is
112enabled. This is a compilation option. It will not alter the behaviour of JSPs
113that have already been compiled. <code>true</code> or <code>false</code>,
114default <code>true</code>.
115</li>
116
117<li><strong>engineOptionsClass</strong> - Allows specifying the Options class
118used to configure Jasper. If not present, the default EmbeddedServletOptions
119will be used.
120</li>
121
122<li><strong>errorOnUseBeanInvalidClassAttribute</strong> - Should Jasper issue
123an error when the value of the class attribute in an useBean action is not a
124valid bean class? <code>true</code> or <code>false</code>, default
125<code>true</code>.</li>
126
127<li><strong>fork</strong> - Have Ant fork JSP page compiles so they are
128performed in a separate JVM from Tomcat? <code>true</code> or
129<code>false</code>, default <code>true</code>.</li>
130
131<li><strong>genStringAsCharArray</strong> - Should text strings be generated as char
132arrays, to improve performance in some cases? Default <code>false</code>.</li>
133
134<li><strong>ieClassId</strong> - The class-id value to be sent to Internet
135Explorer when using &lt;jsp:plugin&gt; tags. Default
136<code>clsid:8AD9C840-044E-11D1-B3E9-00805F499D93</code>.</li>
137
138<li><strong>javaEncoding</strong> - Java file encoding to use for generating
139java source files. Default <code>UTF8</code>.</li>
140
141<li><strong>keepgenerated</strong> - Should we keep the generated Java source
142code for each page instead of deleting it? <code>true</code> or
143<code>false</code>, default <code>true</code>.</li>
144
145<li><strong>mappedfile</strong> - Should we generate static content with one
146print statement per input line, to ease debugging?
147<code>true</code> or <code>false</code>, default <code>true</code>.</li>
148
149<li><strong>maxLoadedJsps</strong> - The maximum number of JSPs that will be
150loaded for a web application. If more than this number of JSPs are loaded, the
151least recently used JSPs will be unloaded so that the number of JSPs loaded at
152any one time does not exceed this limit. A value of zero or less indicates no
153limit. Default <code>-1</code></li>
154
155<li><strong>jspIdleTimeout</strong> - The amount of time in seconds a JSP can be
156idle before it is unloaded. A value of zero or less indicates never unload.
157Default <code>-1</code></li>
158
159<li><strong>modificationTestInterval</strong> - Causes a JSP (and its dependent
160files) to not be checked for modification during the specified time interval
161(in seconds) from the last time the JSP was checked for modification. A value of
1620 will cause the JSP to be checked on every access. Used in development mode
163only. Default is <code>4</code> seconds.</li>
164
165<li><strong>recompileOnFail</strong> - If a JSP compilation fails should the
166modificationTestInterval be ignored and the next access trigger a re-compilation
167attempt? Used in development mode only and is disabled by default as compilation
168may be expensive and could lead to excessive resource usage.</li>
169
170<li><strong>scratchdir</strong> - What scratch directory should we use when
171compiling JSP pages? Default is the work directory for the current web
172application.</li>
173
174<li><strong>suppressSmap</strong> - Should the generation of SMAP info for JSR45
175debugging be suppressed? <code>true</code> or <code>false</code>, default
176<code>false</code>.</li>
177
178<li><strong>trimSpaces</strong> - Should white spaces in template text between
179actions or directives be trimmed ?, default <code>false</code>.</li>
180
181<li><strong>xpoweredBy</strong> - Determines whether X-Powered-By response
182header is added by generated servlet. <code>true</code> or <code>false</code>,
183default <code>false</code>.</li>
184</ul>
185</p>
186
187<p>The Java compiler from Eclipse JDT in included as the default compiler. It is
188an advanced Java compiler which will load all dependencies from the Tomcat class
189loader, which will help tremendously when compiling on large installations with
190tens of JARs. On fast servers, this will allow sub-second recompilation cycles
191for even large JSP pages.</p>
192
193<p>Apache Ant, which was used in previous Tomcat releases, can be used instead
194of the new compiler by configuring the compiler attribute as explained above.
195</p>
196
197</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Known issues"><!--()--></a><a name="Known_issues"><strong>Known issues</strong></a></font></td></tr><tr><td><blockquote>
198
199<p>As described in
200<a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=39089">
201bug 39089</a>, a known JVM issue,
202<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6294277">
203bug 6294277</a>, may cause a
204<code>java.lang.InternalError: name is too long to represent</code> exception
205when compiling very large JSPs. If this is observed then it may be worked around
206by using one of the following:
207<ul>
208<li>reduce the size of the JSP</li>
209<li>disable SMAP generation and JSR-045 support by setting
210<code>suppressSmap</code> to <code>true</code>.</li>
211</ul>
212</p>
213
214</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Production Configuration"><!--()--></a><a name="Production_Configuration"><strong>Production Configuration</strong></a></font></td></tr><tr><td><blockquote>
215
216<p>The main JSP optimization which can be done is precompilation of JSPs.
217However, this might not be possible (for example, when using the
218jsp-property-group feature) or practical, in which case the configuration of the
219Jasper servlet becomes critical.</p>
220
221<p>When using Jasper 2 in a production Tomcat server you should consider making
222the following changes from the default configuration.
223<ul>
224<li><strong>development</strong> - To disable on access checks for JSP
225pages compilation set this to <code>false</code>.</li>
226<li><strong>genStringAsCharArray</strong> - To generate slightly more efficient
227char arrays, set this to <code>true</code>.</li>
228<li><strong>modificationTestInterval</strong> - If development has to be set to
229<code>true</code> for any reason (such as dynamic generation of JSPs), setting
230this to a high value will improve performance a lot.</li>
231<li><strong>trimSpaces</strong> - To remove useless bytes from the response,
232set this to <code>true</code>.</li>
233</ul>
234</p>
235
236</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Web Application Compilation"><!--()--></a><a name="Web_Application_Compilation"><strong>Web Application Compilation</strong></a></font></td></tr><tr><td><blockquote>
237
238<p>Using Ant is the preferred way to compile web applications using JSPC. Note
239that when pre-compiling JSPs, SMAP information will only be included in the
240final classes if suppressSmap is false and compile is true.
241Use the script given below (a similar script is included in the "deployer"
242download) to precompile a webapp:
243</p>
244
245<p>
246<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
247&lt;project name="Webapp Precompilation" default="all" basedir="."&gt;
248
249 &lt;import file="${tomcat.home}/bin/catalina-tasks.xml"/&gt;
250
251 &lt;target name="jspc"&gt;
252
253 &lt;jasper
254 validateXml="false"
255 uriroot="${webapp.path}"
256 webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml"
257 outputDir="${webapp.path}/WEB-INF/src" /&gt;
258
259 &lt;/target&gt;
260
261 &lt;target name="compile"&gt;
262
263 &lt;mkdir dir="${webapp.path}/WEB-INF/classes"/&gt;
264 &lt;mkdir dir="${webapp.path}/WEB-INF/lib"/&gt;
265
266 &lt;javac destdir="${webapp.path}/WEB-INF/classes"
267 optimize="off"
268 debug="on" failonerror="false"
269 srcdir="${webapp.path}/WEB-INF/src"
270 excludes="**/*.smap"&gt;
271 &lt;classpath&gt;
272 &lt;pathelement location="${webapp.path}/WEB-INF/classes"/&gt;
273 &lt;fileset dir="${webapp.path}/WEB-INF/lib"&gt;
274 &lt;include name="*.jar"/&gt;
275 &lt;/fileset&gt;
276 &lt;pathelement location="${tomcat.home}/lib"/&gt;
277 &lt;fileset dir="${tomcat.home}/lib"&gt;
278 &lt;include name="*.jar"/&gt;
279 &lt;/fileset&gt;
280 &lt;fileset dir="${tomcat.home}/bin"&gt;
281 &lt;include name="*.jar"/&gt;
282 &lt;/fileset&gt;
283 &lt;/classpath&gt;
284 &lt;include name="**" /&gt;
285 &lt;exclude name="tags/**" /&gt;
286 &lt;/javac&gt;
287
288 &lt;/target&gt;
289
290 &lt;target name="all" depends="jspc,compile"&gt;
291 &lt;/target&gt;
292
293 &lt;target name="cleanup"&gt;
294 &lt;delete&gt;
295 &lt;fileset dir="${webapp.path}/WEB-INF/src"/&gt;
296 &lt;fileset dir="${webapp.path}/WEB-INF/classes/org/apache/jsp"/&gt;
297 &lt;/delete&gt;
298 &lt;/target&gt;
299
300&lt;/project&gt;
301</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
302</p>
303
304<p>
305The following command line can be used to run the script
306(replacing the tokens with the Tomcat base path and the path to the webapp
307which should be precompiled):<br>
308<div align="left"><table cellspacing="4" cellpadding="0" border="0"><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#ffffff" height="1"><pre>
309$ANT_HOME/bin/ant -Dtomcat.home=&lt;$TOMCAT_HOME&gt; -Dwebapp.path=&lt;$WEBAPP_PATH&gt;
310</pre></td><td bgcolor="#023264" width="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr><tr><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td><td bgcolor="#023264" width="1" height="1"><img src="./images/void.gif" alt="" width="1" height="1" vspace="0" hspace="0" border="0"></td></tr></table></div>
311</p>
312
313<p>
314Then, the declarations and mappings for the servlets which were generated
315during the precompilation must be added to the web application deployment
316descriptor. Insert the <code>${webapp.path}/WEB-INF/generated_web.xml</code>
317at the right place inside the <code>${webapp.path}/WEB-INF/web.xml</code> file.
318Restart the web application (using the manager) and test it to verify it is
319running fine with precompiled servlets. An appropriate token placed in the
320web application deployment descriptor may also be used to automatically
321insert the generated servlet declarations and mappings using Ant filtering
322capabilities. This is actually how all the webapps distributed with Tomcat
323are automatically compiled as part of the build process.
324</p>
325
326<p>
327At the jasper task you can use the option <code>addWebXmlMappings</code> for
328automatic merge the <code>${webapp.path}/WEB-INF/generated_web.xml</code>
329with the current web application deployment descriptor at
330<code>${webapp.path}/WEB-INF/web.xml</code>. When you want to use Java 6
331features inside your jsp's, add the following javac compiler task attributes:
332<code>source="1.6" target="1.6"</code>. For live
333applications you can also compile with <code>optimize="on"</code> and
334without debug info <code>debug="off"</code>.
335</p>
336
337<p>
338When you don't want to stop the jsp generation at first jsp syntax error, use
339<code>failOnError="false"</code>and with
340<code>showSuccess="true"</code> all successfull <i>jsp to java</i>
341generation are printed out. Sometimes it is very helpfull, when you cleanup the
342generate java source files at <code>${webapp.path}/WEB-INF/src</code>
343and the compile jsp servlet classes at
344<code>${webapp.path}/WEB-INF/classes/org/apache/jsp</code>.
345</p>
346
347<p><strong>Hints:</strong>
348<ul>
349<li> When you switch to another Tomcat release, then regenerate and recompile
350your jsp's with the new Tomcat version.</li>
351<li>Use java system property at server runtime to disable PageContext pooling
352<code>org.apache.jasper.runtime.JspFactoryImpl.USE_POOL=false</code>.
353and limit the buffering with
354<code>org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true</code>. Note
355that changing from the defaults may affect performance, but it will vary
356depending on the application.</li>
357</ul>
358</p>
359</blockquote></td></tr></table><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="Optimisation"><strong>Optimisation</strong></a></font></td></tr><tr><td><blockquote>
360<p>
361There are a number of extension points provided within Jasper that enable the
362user to optimise the behaviour for their environment.
363</p>
364
365<p>
366The first of these extension points is the tag plug-in mechanism. This allows
367alternative implementations of tag handlers to be provided for a web application
368to use. Tag plug-ins are registered via a <code>tagPlugins.xml</code> file
369located under <code>WEB-INF</code>. A sample plug-in for the JSTL is included
370with Jasper.
371</p>
372
373<p>
374The second extension point is the Expression Language interpreter. Alternative
375interpreters may be configured through the <code>ServletContext</code>. See the
376<code>ELInterpreterFactory</code> javadoc for details of how to configure an
377alternative EL interpreter.
378</p>
379</blockquote></td></tr></table></td></tr><tr class="noPrint"><td width="20%" valign="top" nowrap class="noPrint"></td><td width="80%" valign="top" align="left"><table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#525D76"><font color="#ffffff" face="arial,helvetica.sanserif"><a name="comments_section" id="comments_section"><strong>Comments</strong></a></font></td></tr><tr><td><blockquote><p class="notice"><strong>Notice: </strong>This comments section collects your suggestions
380 on improving documentation for Apache Tomcat.<br><br>
381 If you have trouble and need help, read
382 <a href="http://tomcat.apache.org/findhelp.html">Find Help</a> page
383 and ask your question on the tomcat-users
384 <a href="http://tomcat.apache.org/lists.html">mailing list</a>.
385 Do not ask such questions here. This is not a Q&amp;A section.<br><br>
386 The Apache Comments System is explained <a href="/tomcat-7.0-doc/comments.html">here</a>.
387 Comments may be removed by our moderators if they are either
388 implemented or considered invalid/off-topic.</p><script type="text/javascript"><!--//--><![CDATA[//><!--
389 var comments_shortname = 'tomcat';
390 var comments_identifier = 'http://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html';
391 (function(w, d) {
392 if (w.location.hostname.toLowerCase() == "tomcat.apache.org") {
393 d.write('<div id="comments_thread"><\/div>');
394 var s = d.createElement('script');
395 s.type = 'text/javascript';
396 s.async = true;
397 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
398 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
399 }
400 else {
401 d.write('<div id="comments_thread"><strong>Comments are disabled for this page at the moment.<\/strong><\/div>');
402 }
403 })(window, document);
404 //--><!]]></script></blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr noshade size="1"></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font color="#525D76" size="-1"><em>
405 Copyright &copy; 1999-2013, Apache Software Foundation
406 </em></font></div></td></tr></table></body></html>