com.getsnappy.snappyj
Class ServletForwarder

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.getsnappy.snappyj.ServletForwarder
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ServletForwarder
extends javax.servlet.http.HttpServlet

This class is used to forward all web 2.0 requests to the appropriate destination. If it is not configured in your web.xml file, your application server will most likely get a 404 on requests made through the web 2.0 loading methods. Below I've included sample entries that need to be nested directly underneath the web-app tag. ServletForwarder com.getsnappy.w20.ContextServlet ServletForwarder /servletForwarder

Author:
brian
See Also:
Web20Environment, Serialized Form

Nested Class Summary
static class ServletForwarder.Parameters
           
 
Constructor Summary
ServletForwarder()
          This type of ServletForwarder will be use the request passed to doGet or doPost, and load the className from the parameter applicationClassName
ServletForwarder(java.lang.Class httpServlet)
          Define the ApplicationInstance or HttpServlet to forward.
ServletForwarder(java.lang.String className)
          Define the className to forward.
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Call doGet in the underlying servlet defined by the constructor or the one specified by the applicationClassName request parameter if the default contructor was used.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Call doPost in the underlying servlet defined by the constructor or the one specified by the applicationClassName request parameter if the default contructor was used.
 boolean outputHiddenIFrame(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletForwarder

public ServletForwarder()
This type of ServletForwarder will be use the request passed to doGet or doPost, and load the className from the parameter applicationClassName


ServletForwarder

public ServletForwarder(java.lang.String className)
Define the className to forward. This should resolve to an ApplicationInstance or HttpServlet instance. NOTE: the getCompleteClassName will be applied to this className

Parameters:
className -

ServletForwarder

public ServletForwarder(java.lang.Class httpServlet)
Define the ApplicationInstance or HttpServlet to forward. NOTE: the getCompleteClassName will be applied to this className

Parameters:
className -
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Call doGet in the underlying servlet defined by the constructor or the one specified by the applicationClassName request parameter if the default contructor was used.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException
javax.servlet.ServletException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Call doPost in the underlying servlet defined by the constructor or the one specified by the applicationClassName request parameter if the default contructor was used.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException
javax.servlet.ServletException

outputHiddenIFrame

public boolean outputHiddenIFrame(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
                           throws java.io.IOException
Throws:
java.io.IOException