2

I am having terrible problems trying to handle ViewexpiredException correctly using the frameworks JSF 2.1, Seam 2.3, Primefaces 3.4.1, Omnifaces 1.3.

Here you can see a full explanation of my problem I post in primefaces forum: http://forum.primefaces.org/viewtopic.php?f=3&t=28215

In this post I was told to try omnifaces (which I am trying to do now). So I configure it (not sure if correctly) in my project.

I add this to my faces-config.xml:

<application>
<...>
<resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler> 
<...>
</application>


<factory>
<render-kit-factory>org.omnifaces.renderkit.Html5RenderKitFactory</render-kit-factory>
<exception-handler-factory>org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory</exception-handler-factory>
</factory>

Everything seems to work, the FullAjaxExceptionHandlerFactory seems to try to handle the expcetion and try to redirect to login page (see my last post on the primefaces forum) but the app gets frozen and nothing really happend, I am not quite sure if I made a mistake or something.

I've try almost every solution I found on the internet nothing seems to work for me, when something seems to work I get this page after a login (which I was redirect cause the session tomeout): http://img831.imageshack.us/img831/7459/pic4w.png

Thanks in advance

Gsuarez
  • 21
  • 5
  • I don't recognize the problem. A "frozen" response usually indicate incorrect ajax response. Please check in HTTP traffic monitor and share the HTTP response headers/body which you actually retrieved. And also check for any JS errors in JS console. In any case, the root cause of the problem might be related to Seam. It'd be helpful if you create a separate project which reproduces exactly this problem with a minimum of necessary code and configuration and then build a WAR from it and report an issue at OmniFaces where you can upload the WAR: http://code.google.com/p/omnifaces/issues/list – BalusC Jan 25 '13 at 18:17
  • If you have no idea where to look for HTTP traffic or JS errors, press F12 (screenshot suggests that you're using Chrome, so F12 should be the right key) and the web developer toolbox will show up. The HTTP traffic can be investigated in *Network* tab and JS errors can be investigated in *Console* tab. – BalusC Jan 25 '13 at 18:28
  • I finally I could solve my problem, not quite sure why FullAjaxExceptionHandlerFactory was not working for me, but I could solved whitout it so I could not check your answer. Thank you very much anyway. To see what was my problem see the last post of the primefacesforum post. Bye! – Gsuarez Jan 28 '13 at 13:44
  • Okay, the root cause of the problem is thus related to Seam. Glad you solved it. You're obligated to post the answer here and mark it accepted. – BalusC Jan 28 '13 at 13:52
  • Thanks BalusC, yes it totally was related to Seam, hope to have oportunity to use omnifaces soon. Bye! – Gsuarez Feb 01 '13 at 15:12

1 Answers1

0

Thank you very much for you replies. I finally solve it.

I am not quite sure why, but this atribute login-view-id="/login.xhtml" in the tag "pages" of pages.xml file was avoiding the "process" of this code:

<exception class="org.jboss.seam.security.NotLoggedInException">
  <redirect view-id="/login.xhtml">
     <message>Debe loguearse para continuar</message>
  </redirect>

After I removed the login-view-id attribute the NotLoggedInException start being handled, but I still had the same problem once I log in so I add and finally that solved the problem, so the fully tag end like this:

<exception class="org.jboss.seam.security.NotLoggedInException">
   <end-conversation/>
  <redirect view-id="/login.xhtml">
     <message>Debe loguearse para continuar</message>
  </redirect>

Thank you very much!

Gsuarez
  • 21
  • 5