3 Replies Latest reply on Oct 10, 2006 1:40 PM by Louis Coetzee

    Runtime specification of viewId in Redirect ?

    Louis Coetzee Apprentice

      Hi,

      I am making use of the @Redirect tag as below:

      @ApplicationException(rollback=true)
      @Redirect(viewId = "/secure/structure/management/adminHome.xhtml")
      public class NAPException extends Exception implements Serializable {


      This works well. However, ideally I would like to configure the viewId at runtime to direct to a specfic page (depending on what the user was doing and where the exception got thrown).. eg.

      @Name("napException")
      @ApplicationException(rollback=true)
      @Redirect(viewId = "#{napException.viewId}")
      public class NAPException extends Exception implements Serializable {
       @Out(required=false)
       private String viewId;
       public NAPException(String message) {
       super(message);
       }
      
       public NAPException(String viewId, String message) {
       super(message);
       this.viewId=viewId;
       }
      
       public String getViewId() {
       return viewId;
       }
      
      
       public void setViewId(String viewId) {
       this.viewId = viewId;
       }
      }


      and invoked through:
      throw new NAPException("/secure/structure/management/adminHome.xhtm",e);


      Unfortunately the above does not work, Is there a way I can specify the target viewId ?

      Thanks

      Louis