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 Connection between a standalone application & a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Connection between a standalone application & a Servlet" Watch "Connection between a standalone application & a Servlet" New topic
Author

Connection between a standalone application & a Servlet

Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
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


Regards,
Jignesh

The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
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.


42
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

  • RMI

  • http://java.sun.com/products/jdk/rmi/
  • JMS

  • http://java.sun.com/products/jms/
  • XML-RPC

  • http://ws.apache.org/xmlrpc/
  • Web-Services

  • http://ws.apache.org/axis/index.html
  • JMX

  • http://java.sun.com/products/JavaManagement/

    Which is right for you?..
    It depends on what you're doing.


    Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Connection between a standalone application & a Servlet
     
    Similar Threads
    Sending an Array to a Servlet
    Invoke other program from servlet
    BIRT plugin for Netbeans
    installer for standalone application
    Deploy Java Application On Customer Side?