hai friends, i have a problem with retrieving a parameter from a link using HttpServletRequest object. Following is the code
String action = request.getParameter("action");
PrintWriter out = response.getWriter();
response.setContentType("text/html");
if(action != null && action.equals("invalidate"))
{
HttpSession session = request.getSession();
session.invalidate();
}
out.println("<a href=\"http://localhost:8080/servlets-examples/Session1 \""+"?action=invalidate>");
Assume that the previous out.println statement is in a single line.
But action is always assigned null value. Why request(HttpSrevletRequest object)is not able to read "action" parameter from the link i created in the
servlet. Is there any thing wrong with the syntax i used in out.println statement?
thank u in advance