Hello,
let's image situation. I have component that has method annotated by @Begin and @Create. I need redirect to some page if the special situation occurs:
if (a == null) { // redirect to /show.xhtml WITH PARAM contentId=aaa }
but
this not works:
FcesContext.getCurrentInstance().getExternalContext().redirect("/show.seam?contentId=email-validation-error"); getCurrentInstance().responseComplete();
this work's not too:
Redirect.instance().setViewId("/show.xhtml"); Redirect.instance().setParameter("contentId", "email-validation-error"); Redirect.instance().execute();
I can throw an application exception and redirect BUT ONLY without parameters - and the show.xhtml without params throws 404 exception :)
Know somebody how to redirect ?
Thanks MIla
Depending on what you are trying to achieve, you can create a page action instead of relying on the @Create callback. In that method you return null to stay on the page or a String mapping to forward or redirect.