Link to home
Start Free TrialLog in
Avatar of glogin
glogin

asked on

Page after Tomcat login

Hi all

I make use the Tomcat Form Login
- username = j_username
- password = j_password
- form action = j_security_check

I know that login failure page can be managed by web.xml login-module
But ,how can I manage the login success page configuration?

Thanks/Glogin
Avatar of girionis
girionis
Flag of Greece image

The default is the index.jsp/index.html etc. Tomcat should know which resource you tried to access and will redirect you there. For example if you have a /secure/mypage.jsp and you try to access this page without first logging in then you should see the login authentication page. Once you successfully log in Tomcat should reidrect you to the /secure/mypage.jsp.
ASKER CERTIFIED SOLUTION
Avatar of ss_p
ss_p

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> where login.html will be be sucess page

I think you mean login.html will be the page with the login form. Or not?
Avatar of ss_p
ss_p

yes

web.xml clearly statest that loginform is contained in login.html
hi

it need not be a html with the form

<login-config>
<auth-method>FORM</auth-method>
<realm-name>Your realm ....</realm-name>
<form-login-config>
<form-login-page>/loginServlet</form-login-page>
<form-error-page>/loginServlet?STATUS=ERROR</form-error-page>
</form-login-config>
</login-config>

in LoginServlet have attribute STATUS and LOGIN_TYPE

you can get the parameter

get the STATUS and LOGIN_TYPE fromt he request parameter.

Based on this you can control the flow.

<form-login-page>/loginServlet</form-login-page>

is actually a sucess url
It can be anything. If it is a servlet or another JSP page the flow can be directed into another page after successful login.
hi Glogin

did you find this information useful

Thanks/SSP