Class SilverpeasHttpServlet

    • Constructor Detail

      • SilverpeasHttpServlet

        public SilverpeasHttpServlet()
    • Method Detail

      • service

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

        protected SilverpeasHttpServlet.UserSessionStatus existOpenedUserSession​(javax.servlet.http.HttpServletRequest request)
        Indicates if it exists an opened user session.
        Parameters:
        request - the current request.
        Returns:
        true if it exists an opened user session, false otherwise.
      • redirectOrForwardService

        protected void redirectOrForwardService​(javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response,
                                                String destination)
                                         throws javax.servlet.ServletException,
                                                IOException
        Handle the sendRedirect or the forward.
        Throws:
        javax.servlet.ServletException - on redirect or forward error.
        IOException - on redirect error.
      • throwHttpPreconditionFailedError

        protected void throwHttpPreconditionFailedError()
        The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource meta-information (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.
      • throwHttpForbiddenError

        protected void throwHttpForbiddenError()
        The HTTP server understood the request, but is refusing to fulfill it. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable (for example the server is an Intranet and only the LAN machines are authorized to connect).
      • throwHttpNotFoundError

        protected void throwHttpNotFoundError()
        The server has not found anything matching the requested address (URI) ( not found ). This means the URL you have typed or clicked on is wrong or obsolete and does not match any document existing on the server (you may try to gradually remove the URL components from the right to the left to eventually retrieve an existing path).
      • throwHttpPreconditionFailedError

        protected void throwHttpPreconditionFailedError​(String message)
        The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource meta-information (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.
      • throwHttpForbiddenError

        protected void throwHttpForbiddenError​(String message)
        The HTTP server understood the request, but is refusing to fulfill it. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable (for example the server is an Intranet and only the LAN machines are authorized to connect).
      • throwHttpNotFoundError

        protected void throwHttpNotFoundError​(String message)
        The server has not found anything matching the requested address (URI) ( not found ). This means the URL you have typed or clicked on is wrong or obsolete and does not match any document existing on the server (you may try to gradually remove the URL components from the right to the left to eventually retrieve an existing path).
      • sendError

        protected void sendError​(javax.servlet.http.HttpServletResponse response,
                                 int status)
        Sends an HTTP error to the client with the specified error code. Once the error is sent, the HTTP response is consumed, and it cannot be used anymore; so the servlet service should return directly after invoking this method.
        Parameters:
        response - the HTTP response
        status - the error status code
      • sendError

        protected void sendError​(javax.servlet.http.HttpServletResponse response,
                                 int status,
                                 String message)
        Sends an HTTP error to the client with the specified error code and error message. Once the error is sent, the HTTP response is consumed, and it cannot be used anymore; so the servlet service should return directly after invoking this method.
        Parameters:
        response - the HTTP response
        status - the error status code
        message - the message to pass in the response and giving details about the error.