5 Replies Latest reply on Jun 9, 2007 8:48 PM by Gavin King

    Simple question from an not-noob developer

    Bram Biesbrouck Newbie

      Hi all,

      Quick question I've been stuggling with for a day now:

      I have a page that uses an outjected variable/bean.
      That variable is set by an action bean after selection from a list.
      However, when a user accesses the target page directly, without going through the selection page, that variable will be null (normal behaviour indeed).

      Now, is there a way to redirect the user to the selection-page when this happens?
      I could do this in a page-action method, but the problem is that the target page is restricted (in pages.xml) :

      <page view-id="/showSpace.xhtml">
       <restrict>#{s:hasPermission('space', 'view', selectedSpaceInstance)}</restrict>
      </page>
      


      The outjected variable in question here is selectedSpaceInstance, and the restriction-check crashes when it is null, throwing this exception:
      javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'selectedSpaceInstance'
      

      even before any page-action is invoked.

      Seems like something simple to me, usually done in pages.xml, but I can't seem to find a solution.

      any help is, of course, welcome.

      b.