Class RootRedirectServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.wso2.carbon.ui.RootRedirectServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class RootRedirectServlet extends javax.servlet.http.HttpServlet
A servlet that handles requests to the root path "/" and redirects to the configured default context (e.g., /carbon/admin/index.jsp). This servlet is necessary because when using OSGi HTTP Whiteboard, the ServletContextHelper (CarbonSecuredHttpContext) registered at path "/" doesn't receive requests for "/" directly unless there's a servlet registered to handle that path. Without this servlet, requests to "/" would result in a 404 error being forwarded to the error page.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor when no CarbonUIDefinitions is available.
    Constructor with CarbonUIDefinitions for getting the default context.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
     
    protected void
    doPost(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 Details

    • RootRedirectServlet

      public RootRedirectServlet(CarbonUIDefinitions carbonUIDefinitions)
      Constructor with CarbonUIDefinitions for getting the default context.
      Parameters:
      carbonUIDefinitions - the UI definitions containing context configuration
    • RootRedirectServlet

      public RootRedirectServlet()
      Default constructor when no CarbonUIDefinitions is available.
  • Method Details

    • doGet

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

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