File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes exact API for java stand-alone application talk to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "exact API for java stand-alone application talk to servlet" Watch "exact API for java stand-alone application talk to servlet" New topic
Author

exact API for java stand-alone application talk to servlet

Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Hi
Please help me I would like to talk to a servlet from a java stand-alone application (richer graphic. What are exact API at both client side and the server side ?
Thanks
Ruilin Yang
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
On the client side you are looking at creating a URLConnection to the URL of a servlet, opening a stream, writing a request and reading a response stream. URLConnection is in the java.net package, part of the standard SDK library.
The alternative would be to open a socket, but URLConnection is simpler.
On the server side you are obviously talking about a class derived from HttpServlet. You can download Tomcat and get the API docs.
Bill
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
William,
Thanks
That is great help. Furthermore I would like to get some code snipets at client program and also in the servlet.
Thanks again
Ruilin
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
try this link
it has code on applet-servlet communication.
im sure ull be able to turn it into application applet.
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Roy,
Thanks
It is good code. It is the same for java application with applet.
Regards,
Ruilin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exact API for java stand-alone application talk to servlet