0

I´m capturing the viewExpiredException this way in pages.xml

<exception class="javax.faces.application.ViewExpiredException">
    <redirect view-id="/error.xhtml">
        <message>#{messages['ViewExpiredException']}</message>
    </redirect>
</exception>

and on the other hand I have this event in my components.xml

<event type="org.jboss.seam.security.loginSuccessful">
    <action execute="#{redirect.returnToCapturedView}"/>
</event>

All my pages have login required :

<page login-required="true" view-id="/home.xhtml">
<page/> 

All works fine with a full postback request but with an ajax request, after the login page, i was redirect to a xml page :

Aucune information de style ne semble associée à ce fichier XML. L'arbre du document est affiché ci-dessous.

<partial-response>  
   <error>
   <error-name>class javax.faces.application.ViewExpiredException</error-name>
   <error-message>viewId:/subject.seam - La vue «/subject.seam» n’a pas pu être restaurée</error-message>
   </error>
</partial-response>  

How I can fix the problem? thanks for help. My configuration project : seam 2.3 final, jsf 2.1, primefaces 3.4 and jbossas7.0.2

kalaoke
  • 107
  • 11
  • I don't do Seam, so I have no idea what's "the Seam way" of solving this, but when ignoring Seam in the complete picture, your issue is basically a duplicate of http://stackoverflow.com/questions/13457666/viewexpiredexception-why-different-behaviour – BalusC Nov 29 '12 at 19:26
  • @BalusC Thanks for your help. I try your fullAjaxExceptionHandler solution but i have again a xml page which is a partial response of the page after the redirect. – kalaoke Nov 30 '12 at 10:05
  • @BalusC When I delete the jsessionId, seam redirect me to the login page because notloggedInExcpetion in pages.After loggedIn I want to be redirect to http://localhost:8080/subject.seam?s=52103. All works fine with a full request but with ajax request the url is http://localhost:8080/subject.seam?javax.faces.partial.render=editor&javax.faces.partial.execute=j_idt368&javax.faces.source=j_idt368&j_idt368=j_idt368&j_idt367=j_idt367&javax.faces.partial.ajax=true&javax.faces.ViewState=-6640091254798567428%3A6977899159286754818&cid=26. – kalaoke Nov 30 '12 at 10:07
  • @BalusC I try this solution [link]http://stackoverflow.com/questions/12504131/viewexpiredexception-not-thrown-on-ajax-request-if-jsf-page-is-protected-by-j-se[/link] but after the redirect the originalURL is null and context.getPartialViewContext().isAjaxRequest() is false – kalaoke Nov 30 '12 at 10:15
  • Well, probably you're forced to solve it "the Seam way". – BalusC Nov 30 '12 at 10:30

0 Answers0