1 Reply Latest reply on Mar 5, 2010 3:02 PM by germanescobar

    Redirect from @Create method

    mvlach

      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