I use container managed security in my JSF app so I have a login page with below default setup.
Now in the login page, I wanted to add a button beside the login button to allow the user to register.
But how do I forward it to my register.xhtml page from my register button? I tried it with this code:
<form method="post" action="j_security_check">
<div id="login-content">
<p>Login to access secure pages:</p>
<p:panelGrid columns="2">
<h:outputLabel for="j_username" value="Username" />
<input type="text" name="j_username" id="j_username" />
<h:outputLabel for="j_password" value="Password" />
<input type="password" name="j_password" id="j_password" />
<f:facet name="footer">
<input type="submit" name="submit" value="Login" />
<input type="button" name="register"
value="#{request.contextPath}/pages/public/register.xhtml" />
</f:facet>
</p:panelGrid>
</div>
</form>
I tried changing also the form to h:form so that I could use the p:commandButton but as I notice, my login page is not working and nothing is happening when I click the submit button.
How to achieve what I want to do?