I have one requirement in which I must create a log in page such way that if log in fails, user should be redirected to the same page with 'error message'.
I am only supposed to use JSP and javascript for validation.
Please suggest me something over it.
Thanks.
Asked
Active
Viewed 3,156 times
0

Supereme
- 2,379
- 12
- 46
- 67
-
Too bad that you're restricted to JSP/JS. You *normally* use a servlet for this. See also the postprocessing part of this answer for hints: http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files/3180202#3180202 – BalusC Feb 07 '11 at 12:09
1 Answers
0
You can not check for login in same jsp page so you need a processing page between home page and login page.
Make a processing page may be named as authentication.jsp
now check for login in this page and if login gets successful redirect to home page and if login page fails redirect back to login page. you can use response.redirect
or <c:redirect>
to redirect to login page.

Harry Joy
- 58,650
- 30
- 162
- 207