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

How do I call doPost?

M Jay
Ranch Hand

Joined: Sep 21, 2004
Posts: 66
I am required to use a servlet which has an implementation for both doGet and doPost. However I am required to call the doPost method by "posting" an xml file(or SOAP message). Any idea how I can do that? some code illustration will be greatly appreciated.


SCJP J2SE 1.4<br />SCBCD J2EE 1.3
Vicky Pandya
Ranch Hand

Joined: Dec 16, 2004
Posts: 148
you can call doPost from doGet() if that's what you are asking.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

What mechanism are you using to initiate the request?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
M Jay
Ranch Hand

Joined: Sep 21, 2004
Posts: 66
Basically I have a set of parameters that I need to pass to a servlet. Previously I was passing them by calling the servlet like

this "http://localhost:8080/.../Servlet?param1=?¶m2=?"

So I assume the above calls the doGet method of the servlet.

Now I am required to implement a doPost method for the same servlet, which would receive those parameters in an XML file. So I am sending the attributes via SOAP to the doPost. This is the code for the class that initiates the request:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I call doPost?
 
Similar Threads
Rookie Question about Servlet's Service method
Service method
Servlet Invocation
Null Pointer Exception
About doPost in servlet