My question is i have a login.jsp , a LoginAuthenticate.java servlet and a home.jsp page..here i am checking login details i.e., id and password, if the LoginAuthenticate.java certifies the user, it gets redirected to home.jsp page, and if it fails it redirects to login.jsp page again, now what i want to do is that if the login.jsp page is called by LoginAuthenticate.java servlet than it must also display a msg indicating login failed , i try with a if statement but i don’t know how exactly i came to know that this login.jsp is called by that servlet??? Is there a method with request object by which i can compare the caller servlet name?
My question is i have a login.jsp , a LoginAuthenticate.java servlet and a home.jsp
Share
You shouldn’t be going directly to a JSP page anyway, ideally.
In any case. The easiest way would be to set a request parameter in the servlet:
Then check for the presence of that attribute in the JSP.