Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/9.4.x/configuring-jsp.html')
-rw-r--r--documentation/9.4.x/configuring-jsp.html16
1 files changed, 10 insertions, 6 deletions
diff --git a/documentation/9.4.x/configuring-jsp.html b/documentation/9.4.x/configuring-jsp.html
index 104be9501c..3dddc23b1c 100644
--- a/documentation/9.4.x/configuring-jsp.html
+++ b/documentation/9.4.x/configuring-jsp.html
@@ -17,7 +17,7 @@
<span class="website">www.webtide.com</span></a></h5><p>
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ...
scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development
- </p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="configuring-jsp"></a>Chapter&nbsp;8.&nbsp;Configuring JSP Support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="configuring-jsp.html#jsp-support">Configuring JSP</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="jsp-support"></a>Configuring JSP</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="configuring-jsp.html#which-jsp-implementation">Which JSP Implementation</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#_precompiling_jsps">Precompiling JSPs</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#modifying-configuration">Modifying Configuration</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#using-jstl-taglibs-for-jetty7-jetty8">Using JSTL Taglibs</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#using-jsf-taglibs">Using JSF Taglibs</a></span></dt></dl></div><p>This document provides information about configuring Java Server Pages (JSP) for Jetty.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="which-jsp-implementation"></a>Which JSP Implementation</h3></div></div></div><p>As of Jetty 9.2, Jetty is using Jasper from <a class="link" href="http://tomcat.apache.org/tomcat-8.0-doc/jasper-howto.html" target="_top">Apache</a> as the default JSP container implementation.</p><p>By default the Jetty distribution enables the JSP <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a>, and by default, this <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a> is set to Apache Jasper.</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>[description]
+ </p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="configuring-jsp"></a>Chapter&nbsp;8.&nbsp;Configuring JSP Support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="configuring-jsp.html#jsp-support">Configuring JSP</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="jsp-support"></a>Configuring JSP</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="configuring-jsp.html#which-jsp-implementation">Which JSP Implementation</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#_precompiling_jsps">Precompiling JSPs</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#modifying-configuration">Modifying Configuration</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#using-jstl-taglibs-for-jetty7-jetty8">Using JSTL Taglibs</a></span></dt><dt><span class="section"><a href="configuring-jsp.html#using-jsf-taglibs">Using JSF Taglibs</a></span></dt></dl></div><p>This document provides information about configuring Java Server Pages (JSP) for Jetty.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="which-jsp-implementation"></a>Which JSP Implementation</h3></div></div></div><p>Jetty uses Jasper from <a class="link" href="http://tomcat.apache.org/tomcat-8.0-doc/jasper-howto.html" target="_top">Apache</a> as the default JSP container implementation.</p><p>By default the Jetty distribution enables the JSP <a class="link" href="startup-modules.html" title="Managing Startup Modules">module</a>, and by default, this module is set to Apache Jasper.</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>[description]
Enables JSP for all webapplications deployed on the server.
[depend]
@@ -32,7 +32,7 @@ You can do this using a servlet context init-param called <code class="literal">
&lt;param-value&gt;com.acme&lt;/param-value&gt;
&lt;/context-param&gt;</code></pre><div class="blockquote"><blockquote class="blockquote"><div xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><i class="fa fa-asterisk" aria-hidden="true"></i> Note</h3><p>Both Jetty Maven plugins - <a class="link" href="jetty-jspc-maven-plugin.html" title="Jetty Jspc Maven Plugin">jetty-jspc-maven-plugin</a> and the <a class="link" href="jetty-maven-plugin.html" title="Configuring the Jetty Maven Plugin">jetty-maven-plugin</a> - will only use Apache Jasper.</p></div></blockquote></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="compiling-jsps"></a>Apache JSP Container</h4></div></div></div><p>By default, the Apache JSP container will look for the Eclipse Java Compiler (jdt).
The Jetty distribution ships a copy of this in <code class="literal">{$jetty.home}/lib/apache-jsp</code>.
-If you wish to use a different compiler, you will need to configure the <code class="literal">compilerClassName</code> init-param on the <code class="literal">JspServlet</code> with the name of the class.</p><div class="table"><a name="d0e7854"></a><p class="title"><b>Table&nbsp;8.1.&nbsp;Understanding Apache JspServlet Parameters</b></p><div class="table-contents"><table class="table" summary="Understanding Apache JspServlet Parameters" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"><col class="col_4"></colgroup><thead><tr><th align="left" valign="top">init param</th><th align="left" valign="top">Description</th><th align="left" valign="top">Default</th><th align="left" valign="top"><code class="literal">webdefault.xml</code></th></tr></thead><tbody><tr><td align="left" valign="top"><p>classpath</p></td><td align="left" valign="top"><p><code class="literal">Classpath used for jsp compilation. Only used if
+If you wish to use a different compiler, you will need to configure the <code class="literal">compilerClassName</code> init-param on the <code class="literal">JspServlet</code> with the name of the class.</p><div class="table"><a name="d0e7851"></a><p class="title"><b>Table&nbsp;8.1.&nbsp;Understanding Apache JspServlet Parameters</b></p><div class="table-contents"><table class="table" summary="Understanding Apache JspServlet Parameters" border="1"><colgroup><col class="col_1"><col class="col_2"><col class="col_3"><col class="col_4"></colgroup><thead><tr><th align="left" valign="top">init param</th><th align="left" valign="top">Description</th><th align="left" valign="top">Default</th><th align="left" valign="top"><code class="literal">webdefault.xml</code></th></tr></thead><tbody><tr><td align="left" valign="top"><p>classpath</p></td><td align="left" valign="top"><p><code class="literal">Classpath used for jsp compilation. Only used if
org.apache.catalina.jsp_classpath context attribute is not
set, which it is in Jetty.</code></p></td><td align="left" valign="top"><p>-</p></td><td align="left" valign="top"><p>&#8211;</p></td></tr><tr><td align="left" valign="top"><p>classdebuginfo</p></td><td align="left" valign="top"><p>Include debugging info in class file.</p></td><td align="left" valign="top"><p>TRUE</p></td><td align="left" valign="top"><p>&#8211;</p></td></tr><tr><td align="left" valign="top"><p>checkInterval</p></td><td align="left" valign="top"><p>Interval in seconds between background recompile checks.
Only relevant if `
@@ -75,7 +75,7 @@ The example below shows how to do this when using the Jetty Maven plugin.</p><pr
&lt;Set name=&gt;"war"&gt;&lt;SystemProperty name=&gt;"jetty.home" &gt;default=&gt;"."/&gt;/webapps/foobar.war&lt;/Set&gt;
&lt;Set name=&gt;"defaultsDescriptor"&gt;/home/smith/dev/webdefault.xml&lt;/Set&gt;
- &lt;/Configure&gt;</code></pre><p>If you want to change the JSP settings for all webapps, edit the <code class="literal">{$jetty.home}/etc/webdefaults.xml</code> file directly instead.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="configuring-jsp-servlet-in-web.xml"></a>Configuring the JSP Servlet in <code class="literal">web.xml</code></h4></div></div></div><p>Another option is to add an entry for the JSPServlet to the <code class="literal">WEB-INF/web.xml</code> file of your webapp and change or add init-params.
+ &lt;/Configure&gt;</code></pre><p>If you want to change the JSP settings for all webapps, edit the <code class="literal">{$jetty.home}/etc/webdefaults.xml</code> file directly instead.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="configuring-jsp-servlet-in-web.xml"></a>Configuring the JSP Servlet in web.xml</h4></div></div></div><p>Another option is to add an entry for the JSPServlet to the <code class="literal">WEB-INF/web.xml</code> file of your webapp and change or add init-params.
You may also add (but not remove) servlet-mappings.
You can use the entry in <a class="link" href="webdefault-xml.html" title="webdefault.xml">{$jetty.home}/etc/webdefault.xml</a> as a starting point.</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code> &lt;servlet id="jsp"&gt;
&lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
@@ -112,8 +112,12 @@ You can use the entry in <a class="link" href="webdefault-xml.html" title="webde
&lt;servlet id="my-servlet"&gt;
&lt;servlet-name&gt;myServlet&lt;/servlet-name&gt;
&lt;servlet-class&gt;com.acme.servlet.MyServlet&lt;/servlet-class&gt;
- ...</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="using-jstl-taglibs-for-jetty7-jetty8"></a>Using JSTL Taglibs</h3></div></div></div><p>The JavaServer Pages Standlard Tag Library (JSTL) is part of the Jetty distribution and is automatically put on the classpath when you <a class="link" href="configuring-jsp.html#which-jsp-implementation" title="Which JSP Implementation">select your flavour of JSP</a>.
-It is also automatically on the classpath for the Jetty Maven plugin, which uses the Apache JSP engine as of Jetty 9.2.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_embedding"></a>Embedding</h4></div></div></div><p>If you are using Jetty in an embedded scenario, and you need to use JSTL, then you must ensure that the JSTL jars are included on the <span class="emphasis"><em>container&#8217;s</em></span> classpath - that is the classpath that is the <span class="emphasis"><em>parent</em></span> of the webapp&#8217;s classpath.
+ ...</code></pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="jsp-async-support"></a>Configuring Async Support</h4></div></div></div><p>By default, Jetty does not enable async support for the JSP servlet.
+Configuring the JSP servlet for async is relatively easy - simply define the <code class="literal">async-supported</code> parameter as <code class="literal">true</code> in either your <code class="literal">webdefault.xml</code> or the <code class="literal">web.xml</code> for a specific context.</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><code>&lt;servlet id="jsp"&gt;
+ &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
+ &lt;async-supported&gt;true&lt;/async-supported&gt;
+&lt;/servlet&gt;</code></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="using-jstl-taglibs-for-jetty7-jetty8"></a>Using JSTL Taglibs</h3></div></div></div><p>The JavaServer Pages Standlard Tag Library (JSTL) is part of the Jetty distribution and is automatically put on the classpath when you <a class="link" href="configuring-jsp.html#which-jsp-implementation" title="Which JSP Implementation">select your flavour of JSP</a>.
+It is also automatically on the classpath for the Jetty Maven plugin, which uses the Apache JSP engine.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="_embedding"></a>Embedding</h4></div></div></div><p>If you are using Jetty in an embedded scenario, and you need to use JSTL, then you must ensure that the JSTL jars are included on the <span class="emphasis"><em>container&#8217;s</em></span> classpath - that is the classpath that is the <span class="emphasis"><em>parent</em></span> of the webapp&#8217;s classpath.
This is a restriction that arises from the JavaEE specification.</p><div class="section"><div class="titlepage"><div><div><h5 class="title"><a name="_apache_jsp"></a>Apache JSP</h5></div></div></div><p>You will need to put the jars that are present in the <code class="literal">{$jetty.home}/lib/apache-jstl</code> directory onto the <span class="emphasis"><em>container&#8217;s</em></span> classpath.
The Apache JSP engine will find the JSTL tag definitions inside these jars during startup.</p><p>As an efficiency enhancement, you can have jetty examine the JSTL jars to find the tags, and pre-feed them into the Apache JSP engine.
This is more efficient, because jetty will only scan the jars you tell it to, whereas the Apache JSP engine will scan every jar, which can be time-consuming in applications with a lot of jars on the container classpath.</p><p>To take advantage of this efficiency enhancement, set up the <a class="link" href="configuring-webapps.html#container-include-jar-pattern" title="org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern">org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</a> to include a <a class="link" href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html" target="_top">pattern</a> that will match the names of the JSTL jars.
@@ -146,7 +150,7 @@ For example:</p><pre xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceF
</script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spnego-support.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="jetty-config-guide.html"><i class="fa fa-chevron-up" aria-hidden="true"></i> Top</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="jetty-admin-guide.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Spnego Support&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></td><td width="40%" align="right" valign="top">&nbsp;Part&nbsp;III.&nbsp;Jetty Administration Guide</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout">
See an error or something missing?
<span class="callout"><a href="http://github.com/eclipse/jetty.project">Contribute to this documentation at
- <span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2016-12-05)</i></span></div></p><script xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" type="text/javascript">
+ <span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2016-12-08)</i></span></div></p><script xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times" type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1149868-7']);
_gaq.push(['_trackPageview']);

Back to the top