jsf 2 - why url not change when handling error page jsf -
i config error page in web.xml following:
<error-page> <exception-type>java.lang.throwable</exception-type> <location>/faces/error.xhtml</location> </error-page> in index.xhtml have 1 input field:
<h:form> <h:inputtext value="#{errorbean.text}" /> <h:commandbutton value="submit" action="index.xhtml"/> </h:form> and managedbean checked user input. if user don't type anything, bean throw exception following:
@managedbean(name = "errorbean") @sessionscoped public class errorbean { private string text; private exception e; /** * creates new instance of errorbean */ public errorbean() { } public string gettext() { return text; } public void settext(string text) throws exception{ if (text.equalsignorecase("")) { throw new exception(); } else { this.text = text; } } } my question is: why exception throw, url in browser :
http://localhost:8888/errornavigator/faces/index.xhtml, i think is:
http://localhost:8888/errornavigator/faces/error.xhtml how config url in browser is:
http://localhost:8888/errornavigator/faces/error.xhtml please me!!!!
Comments
Post a Comment