aspose file tools*
The moose likes Servlets and the fly likes session tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "session tracking" Watch "session tracking" New topic
Author

session tracking

gaurav chhabra
Ranch Hand

Joined: Jul 24, 2004
Posts: 109
i have the code



public void doGet(HttpServletRequest req , HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();

out.println("<form action=\"http://localhost:8080/jai-baba-hanuman\" methord=\"post\">");
out.println("<input type = \"hidden\" name = \"user\" value = \"james\">");
out.println("<input type = \"hidden\" name = \"session\" value = \"786\">");
out.println("<input type = \"hidden\" name = \"user\" value = \"james\">");
out.println("<input type = \"hidden\" name = \"movie\" value = \"jai shri ram\">");
out.println("<input type = \"hidden\" name = \"movie\" value = \"jai mata di\">");
out.println("<input type = \"hidden\" name = \"movie\" value = \"jai baba hanuman\">");
out.println("<input type = \"submit\" value=\"submit\">");
out.println("</form>");
out.println("</body></html>");
out.close();
}

public void doPost(HttpServletRequest req , HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();

out.println("<html>");
out.println("<body>");

String user = req.getParameter("user");
String session = req.getParameter("session");

String[] movies = req.getParameterValues("movie");

if(movies !=null)
{
for(int x=0;x<movies.length;x++)
{
out.println(movies[x]+"<br>");
}
}
out.println("</body></html>");
out.close();

it is written there that doGet serve the doPost methord , how we can we able to do this in servlet.As information is to send by a client and in this , the information is written in the servlet only so whats the use of the client.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

it is written there that doGet serve the doPost methord , how we can we able to do this in servlet.As information is to send by a client and in this , the information is written in the servlet only so whats the use of the client.


gaurav,
Can you work on that question a little more? I really can't understand what you are asking.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session tracking