Class ComponentRequestRouter<T extends ComponentSessionController>

    • Constructor Detail

      • ComponentRequestRouter

        public ComponentRequestRouter()
    • Method Detail

      • getSessionControlBeanName

        public abstract 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"
        Returns:
        the name of the session controller.
      • getDestination

        public abstract String getDestination​(String function,
                                              T componentSC,
                                              HttpRequest request)
        This method has to be implemented by the component request Router it has to compute a destination page
        Parameters:
        function - 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")
      • checkUserAuthorization

        protected boolean checkUserAuthorization​(String function,
                                                 T componentSC)
        Check that user can access the component session controller function. Default behavior return true in order to limit impact for each component session controller. Each session controller must override this method in order to add access control.
        Parameters:
        function - the current function action
        componentSC - the component session controller
        Returns:
        true if user can process function, false else if.
      • hasTheSessionSecurityTokenToBeRenewed

        protected final boolean hasTheSessionSecurityTokenToBeRenewed​(javax.servlet.http.HttpServletRequest request,
                                                                      String function)
        Indicates if the session security token has to be renewed from the given requested function? The answer depends first on the security.web.protection.sessiontoken.renew parameter defined in org/silverpeas/util/security.properties and secondly on the choice made by some of the component request router.
        The Referer information from headers is verified. If the referer is equals to the current request URI, then the session security token is never renewed.
        Returns:
        true if the token has to be renewed
      • doPost

        public void doPost​(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
      • doGet

        public void doGet​(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
      • updateSessionManagement

        public void updateSessionManagement​(javax.servlet.http.HttpSession session,
                                            String destination)
      • emptyJsonResponse

        protected String emptyJsonResponse()
      • sendJson

        protected String sendJson​(String jsonContent)
      • getComponentId

        public static String[] getComponentId​(javax.servlet.http.HttpServletRequest request,
                                              MainSessionController mainSessionCtrl)