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

    Redirect from @Create method

    Miloslav Vlach Novice

      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