Navigated Programatically in JSF
I would like to be able to navigate programatically using JSF. I.e., to forward or sendRedirect() in an action listener method.
In such a method, I was able to get the response:
FacesContext aJSFContext = FacesContext.getCurrentInstance();
ExternalContext aContext = aJSFContext.getExternalContext();
HttpServletResponse aResp =
(HttpServletResponse)aContext.getResponse();
aResp.sendRedirect("myurl");
Here, I get an invalid state exception.
So, can I control when any part of the reponse gets sent out, or is there another way to do this without having to put everything in the navigation rules in faces-config.xml?
Thanks,
Charlie

