[jboss-user] [JBoss Seam] - Runtime specification of viewId in Redirect ?

lcoetzee do-not-reply at jboss.com
Tue Oct 10 10:10:58 EDT 2006


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


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977248#3977248

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977248



More information about the jboss-user mailing list