File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Listen for a POST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Listen for a POST" Watch "Listen for a POST" New topic

Listen for a POST

George Hutto

Joined: Mar 12, 2003
Posts: 8
I could use pointers to the right resource. The array of data and situations on the net is overwhelming.

I'm working with the interface between two companies.

The first wants to send a "silent post" to an https url hosted by the second company ( I am at the second company ). The first company doesn't need to see a web page, this is an automated process.

What I have to do is receive the post, parse out some data and then update a table in our database.

I presume from my readings this can be done as a servlet, am I correct? Should it be done as a servlet or is there a better approach that occurs to any of you off hand?

I know, they are newbish questions. I don't need anyone to write the code for me, just point me in the right directions. As usual, this has to be done in a short time frame and I'm under the gun.

Eduardo Lomonaco

Joined: Oct 13, 2011
Posts: 13
Hi George,

Yes, you're correct that you could use a servlet. You could also use a restful webservice which would also be a nice solution too.
more on that at:

Note that using both of those will require that your application run inside a Container, like tomcat. It's a lil bit more complicated than using plain java SE,
but will enable your application to the web.

There's also the option of using sockets, by in my point of view that would be very primitive AND it would give you a LOT more trouble.
abani patra
Ranch Hand

Joined: Oct 11, 2011
Posts: 70
I agree with Greenhorn you can use servlet for this but best solution is web service , you can use SOAP for this.
Tim Moores

Joined: Sep 21, 2011
Posts: 2413
abani patra wrote:I agree with Greenhorn you can use servlet for this but best solution is web service , you can use SOAP for this.

Yes, you can use SOAP, but why would you? Eduardo already mentioned RESTful web services, which should be the first tool of choice, unless and until it's clear that SOAP's capabilities are actually required. You certainly shouldn't claim it's the "best" solution, because that depends on the requirements about which we know just about nothing.

And yes, you can use servlets to implement simple RESTful web services, but I would advise to use a library like Jersey instead; it makes coding the service much simpler.
I agree. Here's the link:
subject: Listen for a POST
It's not a secret anymore!