3 Replies Latest reply on Jul 14, 2011 9:28 AM by Stefan Schulz

    Exception handling question

    Stefan Schulz Newbie

      Hello.


      I used seam gen from seam version 2.2.0.GA to create a sample project (running in JBoss AS 5.1.0.GA), which i modified to display data from my underlying mssql
      server database via 'dataTable-tag' (which works fine). I marked the stateful session bean fetching my result set as @Restrict(HASH{identity.loggedIn}),
      so im getting (as i excepted) a


      org.jboss.seam.security.NotLoggedInException
      



      My problem is, that


      <exception class="org.jboss.seam.security.NotLoggedInException">
           <redirect view-id="/login.xhtml">
                <message severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
           </redirect>
      </exception>
      


           
      from the components.xml (which i did NOT modify) has no effect (no redirect to the login page, i get a stack trace in my browser instead of that).


      The same entries in the components.xml of seam version 1.2.1.GA (i tried that before) worked (exception was caught, redirect happened).


      Any idea what im doing wrong? Is it possible that the seam-built-in exception handling (via components.xml) does not because in my case the exception
      occurs while rendering the xhtml page? When i simply build a new action with 'seam new-action' (from seam-gen) and i tag the corresponding bean method (which is called on
      button click) as @Restrict(HASH{identity.loggedIn}), everything works fine.


      Thx in advance,


      Stefan