• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

exact API for java stand-alone application talk to servlet

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Roy,
Thanks
It is good code. It is the same for java application with applet.
Regards,
Ruilin
 
reply
    Bookmark Topic Watch Topic
  • New Topic