File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection between a standalone application & a Servlet

 
Jignesh Gohel
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

Can anybody please give me a solution regarding how o connect a servlet & a standalone application like a swing program.if anybody knows ragrding this please reply me as son as possible.

Thanking you,
Jignesh
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's several options you can investigate.
One would be to use Http requests (usually, though servlets can in theory be deployed on servers using other protocols) to communicate with the servlet engine just like a web browser would.
This approach has the major advantage that your servlets don't need to change in any way, they don't even have to know it's not a browser that's connecting.
Your application may need to be more complex than you want it to be though, especially if you need to maintain state between requests (and thus need cookie handling).

Another approach would create an extra service in each servlet, listening in on a standard TCP port. This system could alternatively use RMI as a protocol.
Your application would place calls to this port and the servlet would then be triggered internally by that service.
Of course this means major changes to your servlets.

Last but not least is a kinda hybrid solution which is to implement your servlets to provide SOAP services.
This is now probably pretty much the standardised solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic