org.norther.tammi.spray.connector.chain
Class DefaultRequestDispatcher

java.lang.Object
  extended by org.norther.tammi.spray.connector.chain.DefaultRequestDispatcher
All Implemented Interfaces:
RequestDispatcher

public class DefaultRequestDispatcher
extends Object
implements RequestDispatcher

A default implementation of RequestDispatcher.

Note that we do hide almost everything of the original request, including request attributes, from dispatched request. Otherwise the filtering of the dispatched request would most certainly fail because of state information of the original request maintained in the request attributes by the filters.

The include method implementation uses the writer of the original response to write the included data. If the stream is already in use, it will be applied instead. The filtering of the included request may not set any header value, status codes or other response attributes including the character encoding. The included response has its own output buffer, though, which may be reset independently on the output buffer of the original response.

Author:
Ilkka Priha

Constructor Summary
DefaultRequestDispatcher(String path)
          Constructs a new dispatcher for the encoded path.
DefaultRequestDispatcher(String path, MBeanServer server)
          Constructs a new dispatcher for the encoded path with an MBean server.
 
Method Summary
 void forward(ServletRequest request, ServletResponse response)
           
 void include(ServletRequest request, ServletResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRequestDispatcher

public DefaultRequestDispatcher(String path)
Constructs a new dispatcher for the encoded path.

Parameters:
path - the dispatch path.

DefaultRequestDispatcher

public DefaultRequestDispatcher(String path,
                                MBeanServer server)
Constructs a new dispatcher for the encoded path with an MBean server.

Parameters:
path - the dispatch path.
server - the MBean server.
Method Detail

forward

public void forward(ServletRequest request,
                    ServletResponse response)
             throws ServletException,
                    IOException
Specified by:
forward in interface RequestDispatcher
Throws:
ServletException
IOException

include

public void include(ServletRequest request,
                    ServletResponse response)
             throws ServletException,
                    IOException
Specified by:
include in interface RequestDispatcher
Throws:
ServletException
IOException


Copyright © 2004 The Norther Organization. All rights reserved.