• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doPost

 
Sarada Bhasker
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I invoke the doPost of a servlet from an applet using
URLConnection. Can somebody please help me with an eg(atleast
the code to make the request a doPost)? Thanks a lot in advance.
 
Sanjeev Verma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
You have to use a properties object, store all your parameters in that object, and pass that object thru the output stream obtained from the URLConnection object.
I cannot offer any code right now, you can refer to the Servlets book by O'Reilly. The chapter on Applet Servlet communication speaks a lot about all these issues.
Regards
Sanjeev
 
Brett Knapik
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
look through the URLConnection class there might be a perameter you can put in the property file called setPost() or something. I looked through my professional server programming book and didn't find anything on doPost.

------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
 
Kevin Mukhar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find part of the answer here: http://pages.about.com/kmukhar. I have posted two applets and a servlet there. One applet makes a POST request to the servlet. (That would be the PostApplet.) There is a link to source code at the bottom of the page for the PostApplet.

 
Ashwin Desai
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can use the properties class and pass on the data in this object. You can also consider using HttpMessage class that is a utility class provided by Orielly(Refer Java Servlet Programming).
It is available here.
http://www.servlets.com/resources/com.oreilly.servlet/index.html

Ashwin.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic