• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can i call doGet() and doPost() method of Servlet through applet  RSS feed

 
Usman Zafar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please help me out, how can i call the doGet(..) and doPost(..) method of servlet, i know the procedure that i have to create the URLConnection b/w the servlet and the applet, but the real confusion is some times doGet() is called and sometimes doPost is called, and also when is the servlets init() method called, when the URL.openconnection is called or when the stream is opened......
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to create a HttpURLConnection - it has a setRequestMethod method that can take( "POST" )
The servlet init method is only called once, when the servlet container creates a new instance. This is entirely separate from any pending request.
Bill

------------------
author of:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!