Oracle ADF configurations in web.xml

The Web Application using ADF Faces can have the below configurations in the web.xml
1. Context parameter javax.faces.STATE_SAVING_METHOD. Default value set to client
2. Filters and maping values related to trinidad components
3. Resouce Servlet and maping values related to trinidad components
4. Servlet and maping values related to JSF
5. ADF Authentication servlet and mapping values
6. mime-mapping values for images , css, pdf, applications and javascripts.

 

org.apache.myfaces.trinidad.webapp.TrinidadFilter defined in the filer-class of Trinidad ensures that the ADF Faces are initialized properly. It also processes the file uploads.

org.apache.myfaces.trinidad.webapp.ResourceServlet defined in the servlet-class of resources ensures that the web application resources (images, style sheets, JavaScript libraries) will be delegated to a resource loader

javax.faces.webapp.FacesServlet defined in the servlet-class of Faces Servlet handles the request processing lifecycycle for the web applications.
Context Parameters:

The context parameter – org.apache.myfaces.trinidad.CLIENT_STATE_METHOD is defined to specify the type of client-side state saving to use.
We can define the below given values:

– token: defined to identify the block of a state stored in the HttpSession object, will actually resides on the client.

– all: defined to store all the information in the hidden FORM field and do not use HttpSession.
The context parameter – org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS is defined to specify how many tokens should be stored at any one
time per user when token-based client-side state saving is enabled.

The context parameter – org.apache.myfaces.trinidad.COMPRESS_VIEW_STATE is defined to specify if the global state saving is to be compressed or not.

The context parameter – org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE is defined to enable the Application View Cache
to improve the performance by caching the state of the UI Pages
The context parameter – oracle.adf.view.rich.security.FRAME_BUSTING is useful when we need to show the content of the page in the IFRAME.

 

ADF Session Timeout:

The below configuration allows you to set the session time out value. This can be set from the Overview tab of the web.xml file also.
<session-config>
<session-timeout>40</session-timeout>
</session-config>
ADF Authentication:
You can add the authentication mechanism to be used for authenticating the user credentials by various ways. The below configurations
are required to add the authentication to the ADF Web Application.

<filter-mapping>
<filter-name>adfBindings</filter-name>
<servlet-name>adfAuthentication</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

<servlet>
<servlet-name>adfAuthentication</servlet-name>
<servlet-class>oracle.adf.share.security.authentication.AuthenticationServlet</servlet-class>
<init-param>
<param-name>success_url</param-name>
<param-value>/faces/success.jspx</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>adfAuthentication</servlet-name>
<url-pattern>/adfAuthentication</url-pattern>
</servlet-mapping>

<security-constraint>
<web-resource-collection>
<web-resource-name>allPages</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>valid-users</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>adfAuthentication</web-resource-name>
<url-pattern>/adfAuthentication</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>valid-users</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>   // Authentication Type
</login-config>
<security-role>
<role-name>valid-users</role-name>
</security-role>