I have a jsf web application and in my web.xml I have this configuration:
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/mainLoginPage.jsp</form-login-page>
<form-error-page>/mainLoginPage.jsp?error=true</form-error-page>
</form-login-config>
</login-config>
Well, all works good for url like:
http://localhost:8080/mainLoginPage.jsp
But I would like to also have the possibility to append url parameter for this mainLoginPage, for instance:
http://localhost:8080/mainLoginPage.jsp?co=google
so, based on the company user, mainLoginPage will do the redict to DIFFERENT login pages, for different companies.
If I try the above parameterized url it will not work because it "thinks" that I request another page and being not logged in it redirects me to the default login.jsp.
The question: Is there a way to specify in web.xml that it should let me to add params for this mainLoginPage instead of hardcoding them in web xml like I did for the error page?
Thanks.
I am not sure about parameters in web.xml
error page definitions. But you could create a minimalistic JSP page which forwards you to the one with the parameter, something like this:
<!-- in, say, errorLoginPage.jsp -->
<jsp:forward page="/mainLoginPage.jsp?error=true" /></jsp:forward>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With