How Portal Requests Are Handled
The J2EE 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 a specific PRT (native) component, or iView.
The detailed process flow for running a PRT component starting with this dispatcher servlet, including what methods are called in your portal component, is described in the How Requests Are Handled section of the Portal Runtime .
Process Flow
The simplest way to enter the portal is to enter the following URL:
http://<server>:<port>/irj/portal
The following describes what occurs when the J2EE engine receives such an HTTP request:
The J2EE engine identifies the request as belonging to theirjapplication, and checks theweb.xmlfor that application to determine how to handle the request.
Theweb.xmlfile defines two servlets for handling portal requests:
Gateway servlet
Portal Runtime dispatcher servlet
The J2EE engine selects a servlet based on the URL and the<servlet‑mapping>entries in theweb.xml
The following are the key elements of theweb.xmlfile, which is located inroot/WEB-INFdirectory of the J2EE 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>
The request is sent to the gateway servlet, which does the following:
Checks the URL and determines the alias, or path following the/irj, that was used in the request URL.
Matches the alias to one defined in theweb.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.
Redirects the request to the relative URL for either the standard component of the portallauncher PRTapplication, or to the one that enables anonymous requests.
These URLs are defined by theportal_entry_pointandportal_anonymous_entry_pointparameters of the gateway servlet.
The J2EE again checks theweb.xmlto determine how to handle the redirected request, and this time sends it to thePRTdispatcher servlet.
As part of thePRTengine process flow for running aPRTcomponent, the standard portal connection is called. This connection does the following:
Checks the component application’sportalapp.xmlto determine if anonymous access is permitted, that is, theAuthSchemeproperty is set toanonymous
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 J2EE user management logon page, ad 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 thePRTdispatcher servlet.
The portal connection again checks for a valid cookie, and since one now exists, the process flow continues.
ThePRTengine 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.
The portallauncher component calls the desktop service to get the appropriate desktop for the current user and launches the framework page for the current user.
The detailed request Portal Runtime process flow for rendering a portal component is described in the How Requests Are Handled section of Portal Runtime .