I am having web application where I have to send messages from one servlet to another and servlet to JSP. The default way to do that would be using RequestDispatcher
and calling request.setAttribute("name",message);
.
True, but I have some places where I have to use response.sendRedirect()
in order to stop multiple submitting of forms on manual refersh.
The most known way to send messages in this case would be using Session
and adding the message to the session.
However using session for passing messages is not a good idea, because the message is actually an item which should be belong to the request scope
. So, any other good way of passing it to servlet and Jsp? In JSP I am using JSTL
so please tell me how to get the passed object using that as well.