How can I propertly redirect to a servlet by a backing method?
class MyBean{
public String doRedirect() {
//some conditions
return "newlocation";
}
}
<h:commandButton value="Test" action="#{myBean.doRedirect}" />
This would redirect my to a newlocation.xhtml.
But what if I have a WebServlet?
@WebServlet(urlPatterns = "/newlocation")
How can I then redirect to the servlet instead to an xhtml file?