I have this situation where I am required to show where if user does not enter right password, the program will place an appropriate message in a session & will Dispatch back to the login jsp page and display the message.
I checked this one as well, Redirect to the same page but with a message in it
But when I try implement the answer, the eclipse gives me a red line over the code.
Here is my code,
String message = "Wrong Password!";
HttpSession session = session.setAttribute("message", message);
The error shown is Type Mismatch: Cannot Convert to from void to HttpSession
Any ideas where I am wrong or how can I do this?
this return type is void, hence your pionting to
HttpSessoinObject, so it is giving showing complier error.Use this