Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Exception Handler in adfc-config.xml

HDGeekNov 7 2011 — edited Nov 8 2011
I am trying to incorporate an exception handler to handle session expiration. I have followed the example at this url:
http://www.gebs.ro/blog/oracle/exception-handling-in-adf-11g/

I am not getting it to work. The difference is this example is using JSF1.2 and I am running JSF2.0 in Jdeveloper 11.1.2.1.

Can you help me figure out what I'm missing?

adfc-config.xml code:
<?xml version="1.0" encoding="windows-1252" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
<exception-handler>isSessionExpired</exception-handler>
<router id="isSessionExpired">
<case>
<expression>#{exceptionManager.sessionExpired}</expression>
<outcome>homePage</outcome>
</case>
<default-outcome>homePage</default-outcome>
</router>
<view id="homePage">
<page>/homePage.jspx</page>
</view>
<control-flow-rule>
<from-activity-id>isSessionExpired</from-activity-id>
<control-flow-case>
<from-outcome>homePage</from-outcome>
<to-activity-id>homePage</to-activity-id>
</control-flow-case>
</control-flow-rule>
<managed-bean>
<managed-bean-name>exceptionManager</managed-bean-name>
<managed-bean-class>com.dairynet.pts.util.exceptionManager</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</adfc-config>

Code in my exceptionManager class:
package com.dairynet.pts.util;

import javax.faces.application.ViewExpiredException;

import oracle.adf.controller.ControllerContext;

public class exceptionManager {

public exceptionManager() {
super();
}

public boolean isSessionExpired() {
ControllerContext context = ControllerContext.getInstance();
Exception e = context.getCurrentViewPort().getExceptionData();

if ( e != null && (e instanceof ViewExpiredException)) {
return true;
}
return false;

}

}

When you click on the OK button from the dialog that pops up when the session expires (The page has expired. Click OK to continue.), does this fire this exception handler/router stuff in the adfc-config.xml?

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 6 2011
Added on Nov 7 2011
10 comments
1,890 views