Originally posted by ruquia tabassum:
here in else i can either give alert or redirect back to login.html but how do i get both, any suggestions please.
Alert , you means a JavaScript alert . If thats your need then How come a response from servlet execute those Client side javascript alert !
May be you can simply show a line of text with error message stating "Invalid User Name OR Password !" , for that , your Login Action Servlet looks like this ,
and on
jsp page ,
I hope that's solve your problem . Now still you want that alert to be shown on wrong user id and password , then I suggest go for AJAX !