Show TOC

How Requests Are Handled by ServerLocate this document in the navigation structure

Use

The Java EE application for the portal defines the following two servlets:

  • Gateway : A servlet that handles requests for the portal home page.

  • Portal Runtime Dispatcher : A servlet that handles requests for running specific portal components.

    The detailed process flow for running and rendering a portal component starting with this dispatcher servlet, including what methods are called in your portal component, is described in How Requests Are Handled by Portal Runtime .

The simplest way to access the portal is to enter the following URL: http://<server>:<port>/irj/portal

The following describes the process that occurs when AS Java receives such an HTTP request:

  1. The Java EE engine identifies the request as the one for the irj application, and checks the web.xml for that application to determine how to handle the request. The two servlets for handling portal requests, Gateway and Portal Runtime Dispatcher, are defined in the web.xml file. The engine selects a servlet based on the URL and the <servletmapping> entries in the web.xml .

    The following are the key elements of the web.xml file, which is located in root/WEB-INF directory of the Java EE application directory for the portal ( irj ):

    <web-app>
     
       ...
     
        <!--Gateway Servlet-->
        <servlet>
            <servlet-name>gateway</servlet-name>
            <servlet-class>com.sap.portal.navigation.Gateway</servlet-class>
     
       ...
     
            <!--URLs for standard and anonymous requests-->
            <init-param>
                <param-name>portal_entry_point</param-name>
                <param-value>/servlet/prt/portal/prtroot/
    com.sap.portal.navigation.portallauncher.default</param-value>
            </init-param>
     
            <init-param>
                <param-name>portal_anonymous_entry_point</param-name>
                <param-value>/servlet/prt/portal/prtroot/
    com.sap.portal.navigation.portallauncher.anonymous</param-value>
            </init-param>
     
            <init-param>
                <param-name>portal</param-name>
                <param-value>anonymous=0,proxy=0,low_bandwidth=0,
    include_in_url=1,include_application_name_in_url=1</param-value>
             </init-param>
        </servlet>
     
        <!--PRT dispatcher servlet-->
        <servlet>
            <servlet-name>prt</servlet-name>
            <servlet-class>com.sapportals.portal.prt.dispatcher
    .Dispatcher</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
     
        <!--URL/servlet mapping-->
        <servlet-mapping>
            <servlet-name>gateway</servlet-name>
            <url-pattern>/portal/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>prt</servlet-name>
            <url-pattern>/irj/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>prt</servlet-name>
            <url-pattern>/go/*</url-pattern>
        </servlet-mapping>
     
       ...
     
    </web-app>
                   
  2. The request is sent to the Gateway servlet, which does the following:

    1. Checks the URL and determines the alias, or path following the /irj , that was used in the request URL.

    2. Matches the alias to one defined in the web.xml , and retrieves the settings for that alias, for example, whether the request requires authentication or the request can be accessed anonymously.

      The aliases are defined as parameters of the gateway servlet.

    3. Redirects the request to the relative URL for either the standard component of the portallauncher PRT application, or to the one that enables anonymous requests.

      These URLs are defined by the portal_entry_point and portal_anonymous_entry_point parameters of the gateway servlet.

  3. The Java EE engine checks the web.xml again to determine how to handle the redirected request, and this time sends it to the PRT dispatcher servlet.

  4. As part of the PRT process flow for running a portal component, the standard portal connection is called. This connection does the following:

    1. Checks the component application's portalapp.xml to determine if the AuthScheme property is set to anonymous .

    2. If authentication is required, the portal checks if the user is authenticated by checking if one of the following exists:

      • Valid logon cookie

      • Valid user name and password

      If neither exists, the user is redirected to the Java EE user management logon page, and the following occurs:

      • The user enters a valid user name and password.

      • A logon cookie is created for the user.

      • The request is redirected again to the PRT Dispatcher servlet.

      • The portal connection again checks for a valid cookie, and since one now exists, the process flow continues.

  5. The PRT engine checks the security zone for the requested component, in this case the portallauncher application.

    • If the current user has permission, the component is run.

    • If the current user does not have permission, an error is displayed.

    All users, even anonymous users, have permission to the components of the portallauncher application.

  6. The portallauncher component calls the desktop service to get the appropriate desktop for the current user and renders the framework page for the current user.