Exception Handler in adfc-config.xml
HDGeekNov 7 2011 — edited Nov 8 2011I 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!