Showing posts with label Portal. Show all posts
Showing posts with label Portal. Show all posts

October 7, 2014

ADF_FACES-30108:The view state of the page has expired because of inactivity. Reload the page.

I have several tabs in my portal application, in which some of them are loading data from web services. Some times when I click on those tabs, an alert message with the below error message is displaying and on-click of Ok button, the app is reloading.

The error message:

ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RESTORE_VIEW 1
javax.faces.application.ViewExpiredException: viewId:/oracle/webcenter/portalapp/pages/home.jspx - ADF_FACES-30108:The view state of the page has expired because of inactivity.  Reload the page.


To ignore this error, I have written a filter which validates the app session on every navigation.  And my filter would look like,

package portal;


import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MyFilter implements Filter {
    private FilterConfig fc = null;

    public MyFilter() {

    public void init(FilterConfig filterConfig) throws ServletException {
        fc = filterConfig;

    public void doFilter(ServletRequest servletRequest,
                         ServletResponse servletResponse,
                         FilterChain filterChain) throws IOException,
                                                         ServletException {
        String reqSessionID =
        String currentSessionID =
        String requestURI =
        boolean sameSession =
        System.out.println("currentSessionID == reqSessionID? : " + sameSession);
        if (!sameSession && reqSessionID != null) {
            System.out.println("Session is null");
        } else {
            filterChain.doFilter(servletRequest, servletResponse);
            System.out.println("Continue to servlet.");

    public void destroy() {
        fc = null;

Configured the above filter in web.xml file as below.
   <servlet-name>Faces Servlet</servlet-name>

December 24, 2013

Localization with f: loadBundle

To implement localization in ADF applications, we create property files with the fields and their values in different languages. For example, I have below property file with some fields and their values in Danish language. I want to display these values in the jsf page to the user.
BODY               =Hoveddel
ITEM               =Varepost
SUBMIT           =Indsend
SUMMARY     =Oversigt
COPY            =Kopier

To use these property fields and to display on the jsf page, we were provided a tag called “loadBundle” whose syntax is as below.

<f:loadBundle basename="application" var="app"/>

Where “application” is the basename of the property file and “app” is the variable name to be used in the jsf page to invoke these fields of the property file. If you are using more property files for different language like French,English and Danish, then the property file names should be as follows.

And maken a child entry to the tag <application> for the used languages in the faces-config.xml as below


So, whenever the language is changed, the corresponding property file will be picked up to display the fields.
And to use the fields in the page, we use el expression syntax like #{app.BODY}
In the loadBundle tag, for the basename attribute, we can also pass the ResourceBundle class instead of property file name.

June 6, 2013

Webcenter Portal Display issues in lower versions of IE

I have a portal application developed in JDev 1.6. While running the application, it supposed to be 
displayed full of the browser and it is in Firefox, Chrome and even in IE (version greater than 8). But 
I have a requirement to use this in IE7. When I run this app in IE7, the app is displaying in one third 
of the browser. To make my app displays properly in IE7, I need to write some browser specific 
javascript. Below is my javascript code added to my home page. This script will be executed when 
the browser is IE and its version is 7.

<af:resource type="javascript"> 
browser_version= parseInt(navigator.appVersion);
browser_type = navigator.appName;
if (browser_type == "Microsoft Internet Explorer" ) {
if((browser_version == 4)){
var lineURL = "&lt;style&gt;.af_decorativeBox { width: 100% !important;height: 640px
 !important;}div.af_decorativeBox_center{overflow: hidden !important;}div.af_panelTabbed_body {overflow: auto;}.profileSubHeader{ margin-left: -10px !important}.wid50 input {width: 35px !important;}&lt;/style&gt;";


In the above code, lineURL is a variable which holds css styles which will impact my display in IE7.

December 13, 2012

Import ADF Taskflow into a Portal as a library

To import a ADF task flow into a web center portal application as a library, follow the below procedure

  • Create a deployment profile for the ADF task flow project as “ADF library jar”
  • Deploy and make adf library jar for the ADF task flow
  • Open the Resource Palette on right side of the JDev
  • Right click on “File System” and select the option “New File System Connection”
  • Provide a name to the connection and directory path where the adf task flow jar file is copied
  • The created connection will be added to the Resource Palette
  • Open the Portal application and select the project to which the task flow should be added
  • In the Resource Palette, expand the connection created and right click on the jar file, select the option “Add to Project”. It will ask for the confirmation to which project it will be added
  • Now expand the jar file and drag and drop the task flow listed in a jsf page as a region in which we want to show the task flow