1 Reply Latest reply on Feb 25, 2011 9:37 AM by monkeyden

    Component Required For a Page

    tom_goring

      Hi,


      I have seam 2 app that has been running live for some time now.


      I have a few pages that require a session scoped object to exist.
      Yes I am using conversation scoped objects for most things .


      I'd like to guard these pages so that if they are accessed when the object is not there they get a nice error page.


      I have done this currently with





           <page view-id="/pages/PagesRequireSession*" login-required="true">
                <restrict>#{sessionObject != null}</restrict>
           </page>     
      





      But I don't think it is a very good as it is handled as a org.jboss.seam.security.AuthorizationException.


      Is there a better way ?




        • 1. Re: Component Required For a Page
          monkeyden

          something like this?


          <page view-id="/pages/PagesRequireSession*">
              <navigation>
                  <rule if="#{sessionObject != null}">
                      <redirect view-id="/no-session-error.xhtml"/>
                  </rule>
              </navigation>
          </page>