org.apache.cocoon.components.jsp
Class JSPEngineImplNamedDispatcherInclude

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.jsp.JSPEngineImplNamedDispatcherInclude
All Implemented Interfaces:
LogEnabled, Parameterizable, ThreadSafe, JSPEngine

public class JSPEngineImplNamedDispatcherInclude
extends AbstractLogEnabled
implements JSPEngine, Parameterizable, ThreadSafe

Allows a Servlet or JSP to be used as a generator.

This implementation includes the servlet response using the RequestDispatcher from ServletContext.getNamedDispatcher().

Version:
CVS $Id: JSPEngineImplNamedDispatcherInclude.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Davanum Srinivas, Bernhard Huber

Field Summary
static String CONFIG_FORWARD
          'forward' configuration parameter name for specifying whether or not the dispather should use forward instead of include.
static String CONFIG_SERVLET_NAME
          'servlet-name' configuration parameter name for specifying the servlet name to dispatch to.
static boolean DEFAULT_FORWARD
          Default value of CONFIG_FORWARD.
static String DEFAULT_SERVLET_NAME
          Default value of CONFIG_SERVLET_NAME.
 
Fields inherited from interface org.apache.cocoon.components.jsp.JSPEngine
ROLE
 
Constructor Summary
JSPEngineImplNamedDispatcherInclude()
           
 
Method Summary
 byte[] executeJSP(String url, HttpServletRequest servletRequest, HttpServletResponse servletResponse, ServletContext servletContext)
          Execute the Servlet and return the output.
 void parameterize(Parameters params)
           The forward configuration parameter allows you to control whether to use the forward dispatch method instead of the include method which is used by default.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_SERVLET_NAME

public static final String CONFIG_SERVLET_NAME
'servlet-name' configuration parameter name for specifying the servlet name to dispatch to.

See Also:
Constant Field Values

CONFIG_FORWARD

public static final String CONFIG_FORWARD
'forward' configuration parameter name for specifying whether or not the dispather should use forward instead of include.

See Also:
Constant Field Values

DEFAULT_SERVLET_NAME

public static final String DEFAULT_SERVLET_NAME
Default value of CONFIG_SERVLET_NAME. The value is *.jsp, this is the WLS JSP servlet default name.

See Also:
Constant Field Values

DEFAULT_FORWARD

public static final boolean DEFAULT_FORWARD
Default value of CONFIG_FORWARD. The value is false.

See Also:
Constant Field Values
Constructor Detail

JSPEngineImplNamedDispatcherInclude

public JSPEngineImplNamedDispatcherInclude()
Method Detail

parameterize

public void parameterize(Parameters params)

The forward configuration parameter allows you to control whether to use the forward dispatch method instead of the include method which is used by default.

Using the servlet-name configuration parameter you can specify the name of the Servlet to dispatch to.

Specified by:
parameterize in interface Parameterizable

executeJSP

public byte[] executeJSP(String url,
                         HttpServletRequest servletRequest,
                         HttpServletResponse servletResponse,
                         ServletContext servletContext)
                  throws IOException,
                         ServletException,
                         Exception
Execute the Servlet and return the output.

Specified by:
executeJSP in interface JSPEngine
Throws:
IOException
ServletException
Exception


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.