This doesn't look to be an ICEfaces issue per se. If I remove the ICEfaces libraries and tweak the pages and web.xml so that it's a plain JSF app, the error-page directives noted before will work. However, if I then add Ajax to the buttons:
<h:commandButton value="start" action="#{javax.enterprise.context.conversation.begin()}">
<f:ajax execute="@all" render="@all"/>
</h:commandButton>
<h:commandButton value="noop" action="#{backingBean.noop()}">
<f:ajax execute="@all" render="@all"/>
</h:commandButton>
Then the behaviour is similar to ICEfaces in that a the error-page redirects are not honoured. If in Development mode:
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
JSF will pop up an alert that a server error occurred but in Production mode it just sits there.
So to summarize, the problems are:
- The ICEfaces bridge is looking for a SessionExpiredException returned as the Ajax response in order to trigger the redirect. Since the NonexistentConversationException occurs first, it's returned as the Ajax response and the redirect never happens.
- It's a JSF behaviour to ignore error-page directs for Ajax responses and is not constrained to ICEfaces.
The best/easiest way to handle this might be to use the jsf API on the client (jsf.ajax.addOnError(callback)) and do the redirect in that code. I'll look next at doing something up as an example.
Attached test case that shows the issue. It is setup to run on Jboss EAP 6.1.0 and is compiled using JDK7.
Steps: