The user enters the http://mysite.ru/path/qwerty page. If he is not authorized he throws it on http://mysite.ru/path/login , there he enters the login, password and presses the Login.

How can I redirect him back to http://mysite.ru/path/qwerty ?

Login is done through: request.login(user, pass);

web.xml

 <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/login</form-login-page> <form-error-page>/login</form-error-page> </form-login-config> </login-config> 
  • @fba, According to the rules of the forum, questions should not be limited to the decision or the completion of student assignments. Please clarify what you have done yourself and what did not work out. - Nicolas Chabanovsky

1 answer 1

When you go to the login page, additionally drag along the parameter - the source of the transition, the value of which will be the page URL. After a successful login, just go to this URL.