0 Replies Latest reply on May 13, 2008 11:33 AM by Daniel Nielsen

    Possible bug when using Facelets?

    Daniel Nielsen Newbie

      Hi.


      I'm working on a project using Seam 2.0.2CR2 and trying to learn Seam does it's magic. I use JBoss 4.2.2 and Facelets.


      Unfortunately I'm are having some problems with handling NotLoggedInExceptions and redirects with ui:debug in Facelets.


      In the global template, I have <ui:debug hotkey="m"/> defined at the bottom of the page.


      I have a page that lists some data, using a <h:dataTable>. In each row I have <s:link> for editing and for deleting. Outside the table there is <s:link> to create a new entry. The datamodel used to render the datatable is session scoped and editing / deleting / creation is conversation scoped (and on seperate pages). When logged in and no timeouts occur it works like a charm.


      Trying to simulate timeouts, I log in and navigate to the page with the <h:dataTable> and then clear my session cookies. I then try two things:



      1. I click the Create new link and I'm redirected to the login page, I login and I'm redirected back correctly.

      2. I click the Edit link on one of the entries and I enter a infinite redirection loop until Firefox complains.



      If I remove the ui:debug from the template, all works well. Also, it appears that ui:debug is unable to access the component tree (nothing happens when clicking the link, except javascript errors).


      If ui:debug is intentionally broken, perhaps it should be mentioned in the seam documentation?



      As per the examples in the documentation I've put the following in components.xml:


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


      And in pages.xml:


      <pages ... 
             login-view-id="/login.xhtml">
      ...
      <exception class="org.jboss.seam.security.NotLoggedInException">
        <redirect view-id="/login.xhtml">
          <message severity="warn">You must be a logged in to use this feature</message>
        </redirect>
      </exception>
      
      <exception>
        <end-conversation/>
        <redirect view-id="error.xhtml">
          <message severity="error">Internal server error, please try again.</message>
        </redirect>
      </exception>
      </pages>