File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session tracking

 
gaurav chhabra
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic