blob: bc382e7c5e242217e8475177cd8b24511495a8e0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Generator</title>
<link href="http://purl.org/DC/elements/1.0/" rel="schema.DC">
<meta content="Carsten Ziegeler" name="DC.Creator">
<meta content="This document describes the jsp generator of Cocoon." name="DC.Description">
</head>
<body>
<h1>JSP Generator</h1>
<p>The JspGenerator selects a JSPEngine component. The JSPEngine component
launches a JSP servlet engine of your servlet container,
feeds the HttpRequest into the
JSP servlet engine, and pipes the jsp response as SAX events into Cocoon.
The JSP page is specified by the HttpRequest.
</p>
<p>
This way you can continue to use your JSP pages.
Your migration from JSP to XSP may be done step by step.
You may specify your JSP pages either as JSP scriptlets or as JSP-XML.
But keep in mind that your JSP output should be valid XML.
</p>
<ul>
<li>Name : jsp</li>
<li>Class: org.apache.cocoon.generation.JspGenerator</li>
<li>Cacheable: no</li>
</ul>
<pre class="code">
&lt;map:generate type="jsp"/&gt;
</pre>
<h1>JSPEngine</h1>
<p>As JSP servlet engines are implemented differently, you may have to
select the appropriate JSPEngine component.
The default is a JSPEngine working with Tomcat's JSP servlet engine Jasper.
You may override the cocoon.roles by your own my.roles, as described
in the <a href="../../faq/index.html">FAQs</a>.
</p>
<p>The JSPEngine component of Tomcat's JSPEngine is implemented in JSPEngineImpl.
If you want to use another JSPEngine component, you may specify it in a my.roles file.
The following sample specify in file WEB-INF/my.roles a JSPEngine workging with WebLogicServer:
</p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;role-list&gt;
&lt;role name="org.apache.cocoon.components.jsp.JSPEngine"
shorthand="jsp-engine"
default-class="org.apache.cocoon.components.jsp.JSPEngineImplWLS"/&gt;
&lt;/role-list&gt;
</pre>
<p>Defining the file my.roles this way you must ensure that your
cocoon.xconf refernces my.roles, like that:
</p>
<pre class="code">
...
&lt;cocoon version="2.0" user-roles="WEB-INF/my.roles"&gt;
...
</pre>
<p>Currently there are tree JSPEngine components available:
</p>
<table>
<tr>
<th colspan="1" rowspan="1">JSPEngine</th><th colspan="1" rowspan="1">ServletEngine</th>
</tr>
<tr>
<td colspan="1" rowspan="1">JSPEngineImpl</td><td colspan="1" rowspan="1">Tomcat, generic jsp servlet class</td>
</tr>
<tr>
<td colspan="1" rowspan="1">JSPEngineImplWLS</td><td colspan="1" rowspan="1">WebLogic 5.1, 6.0(?)</td>
</tr>
<tr>
<td colspan="1" rowspan="1">JSPEngineImplNamedDispactcherInclude</td><td colspan="1" rowspan="1">Generic JSP Servlet</td>
</tr>
</table>
<p>The next sections describe the settings of the JSPEngine components.
</p>
<h2>JSPEngineImpl</h2>
<p>This JSPEngine is the default engine selected in cocoon.roles.
By default it uses Tomcats' JASPER JSP servlet engine.
</p>
<p>Running under a different JSP servlet engine, you can try to change the settings
in cocoon.xconf, by modifying parameter name servlet-class to your needs.
</p>
<pre class="code">
&lt;jsp-engine&gt;
&lt;parameter name="servlet-class"
value="my.servlet.MyJspServletOfMyServletEngine"/&gt;
&lt;/jsp-engine&gt;
</pre>
<p>JSPEngineImpl instances directly the JSP servlet engine class, and services
HttpRequest to this instance.
</p>
<p>JSPEngineImplNamedDispatcherInclude delegates the selection of a JSP servlet engine
instance to the servlet engine. It selects by servlet-name, and not by servlet-class.
This is the key differences of these two implementations.
</p>
<h2>JSPEngineImplWLS</h2>
<p>This JSPEngine is implemented especially for WebLogic 5.1. WebLogic 6.0, and WebLogic 6.1
may work, too. JSPEngineImplWLS finds the named request dispatch for jsp, the jsp response
is piped into Cocoon.
</p>
<p>The name of the JSP servlet is by default set to '*.jsp'. This is the default servlet name
of the JSP servlet engine under WLS. You may adopt the parameter servlet-name to your needs.
</p>
<p>If you want to specify a different JSP servlet name, you can change the settings
in cocoon.xconf, by modifying the parameter servlet-name.
</p>
<pre class="code">
&lt;jsp-engine&gt;
&lt;parameter name="servlet-name"
value="MyNameOfMyJspServletOfMyServletEngine"/&gt;
&lt;/jsp-engine&gt;
</pre>
<h2>JSPEngineImplNamedDispatcherInclude</h2>
<p>This JSPEngine is implemented like JSPEnginImplWLS without using any WebLogic classes.
You may try to use this JSPEngine if JSPEngineImpl does not meet your requirements.
</p>
<p>The name of the JSP servlet is by default set to '*.jsp'. This is the default servlet name
of the jsp servlet engine under WLS. You may adopt the parameter servlet-name to your needs.
</p>
<p>If you want to specify a different JSP servlet name, you can change the settings
in cocoon.xconf, by modifying the parameter servlet-name.
</p>
<pre class="code">
&lt;jsp-engine&gt;
&lt;parameter name="servlet-name"
value="MyNameOfMyJspServletOfMyServletEngine"/&gt;
&lt;/jsp-engine&gt;
</pre>
</body>
</html>