In Servlet you can use
request.setAttribute("status","yes")
in jsp, you can retrieve using
request.getAttribute("status");
Yes, I missed the point
for above u need to use
RequestDispatcher rd = request.getRequestDispatcher("somefile.jsp");
rd.forward(request,response);
If u want to use response.sendRedirect("somefile.jsp")
,
u can set the variable in session as
HttpSession session = request.getSession(false);
session.setAttribute("status","yes")
and get it back as
session.getAttribute("status")
.
Once used, u can remove it as
session.removeAttribute("status")