com.stratelia.silverpeas.peasCore.servlets
Class WebComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>,WEB_COMPONENT_REQUEST_CONTEXT extends WebComponentRequestContext<? extends WebComponentController>>

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.stratelia.silverpeas.peasCore.servlets.SilverpeasHttpServlet
              extended by com.stratelia.silverpeas.peasCore.servlets.SilverpeasAuthenticatedHttpServlet
                  extended by com.stratelia.silverpeas.peasCore.servlets.ComponentRequestRouter<T>
                      extended by com.stratelia.silverpeas.peasCore.servlets.WebComponentRequestRouter<T,WEB_COMPONENT_REQUEST_CONTEXT>
Type Parameters:
T - the type of the Component Session Controller that provides a lot of stuff around the component, the user, etc.
WEB_COMPONENT_REQUEST_CONTEXT - the type of the web component context.
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class WebComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>,WEB_COMPONENT_REQUEST_CONTEXT extends WebComponentRequestContext<? extends WebComponentController>>
extends ComponentRequestRouter<T>

This request router is an extension of the historical one. It provides a new way to perform the requests on the server, especially by annoting methods that must be invoked.

See Also:
Serialized Form

Constructor Summary
WebComponentRequestRouter()
           
 
Method Summary
 T createComponentSessionController(MainSessionController mainSessionCtrl, ComponentContext componentContext)
           
protected  void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 String getDestination(String path, T componentSC, HttpRequest request)
          This method has to be implemented by the component request Router it has to compute a destination page
 String getSessionControlBeanName()
          This method has to be implemented in the component request Router class. returns the session control bean name to be put in the request object ex : for almanach, returns "almanach"
 void init(javax.servlet.ServletConfig servletConfig)
           
 
Methods inherited from class com.stratelia.silverpeas.peasCore.servlets.ComponentRequestRouter
checkUserAuthorization, getComponentId, hasTheSessionSecurityTokenToBeRenewed, updateSessionManagement
 
Methods inherited from class com.stratelia.silverpeas.peasCore.servlets.SilverpeasAuthenticatedHttpServlet
getMainSessionController, getSessionInfo, renewSessionSecurityToken, service, throwUserSessionExpiration
 
Methods inherited from class com.stratelia.silverpeas.peasCore.servlets.SilverpeasHttpServlet
redirectOrForwardService, throwHttpForbiddenError, throwHttpNotFoundError, throwHttpPreconditionFailedError
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebComponentRequestRouter

public WebComponentRequestRouter()
Method Detail

init

public void init(javax.servlet.ServletConfig servletConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

getSessionControlBeanName

public String getSessionControlBeanName()
Description copied from class: ComponentRequestRouter
This method has to be implemented in the component request Router class. returns the session control bean name to be put in the request object ex : for almanach, returns "almanach"

Specified by:
getSessionControlBeanName in class ComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>>
Returns:
the name of the session controller.

createComponentSessionController

public T createComponentSessionController(MainSessionController mainSessionCtrl,
                                          ComponentContext componentContext)
Specified by:
createComponentSessionController in class ComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>>

doPut

protected void doPut(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Overrides:
doPut in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doDelete

protected void doDelete(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.ServletException,
                        IOException
Overrides:
doDelete in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
Overrides:
doPost in class ComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>>

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException
Overrides:
doGet in class ComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>>
Throws:
javax.servlet.ServletException

getDestination

public final String getDestination(String path,
                                   T componentSC,
                                   HttpRequest request)
Description copied from class: ComponentRequestRouter
This method has to be implemented by the component request Router it has to compute a destination page

Specified by:
getDestination in class ComponentRequestRouter<T extends WebComponentController<WEB_COMPONENT_REQUEST_CONTEXT>>
Parameters:
path - The entering request function (ex : "Main.jsp", when accessing "http://localhost/webactiv/Ralmanach/jsp/Main.jsp")
componentSC - The component Session Controller, build and initialised.
request - The entering request. The request Router need it to get parameters
Returns:
The complete destination URL for a forward (ex : "/almanach/jsp/almanach.jsp?flag=user")


Copyright © 2016 Silverpeas. All Rights Reserved.