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 web application 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 "web application" Watch "web application" New topic
Author

web application

ham rah
Greenhorn

Joined: Mar 15, 2005
Posts: 6
i have made client in swing
and the server is in servlet deployed on tomcat 5.5
so how can i communicate from swing to servlet
that should be non-http
and secondly can i use remote ejb calls
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This is a nice tutorial.
http://www-128.ibm.com/developerworks/java/library/j-tunnel/

Tomcat is not an EJB container so you will not be able to make EJB calls to it.

Servlets (out of the box anyway) are primarily designed for HTTP calls but as that article shows HTTP doesn't have to mean html. You can post and receive serialized java objects.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Thomas Hubschman
Ranch Hand

Joined: Sep 25, 2002
Posts: 88
Why can you not use HTTP?

Just to clarify Ben's response. You can call a remote EJB from a servlet. You can also call a remote EJB directly from you swing code.

However your EJB requires an application server like JBoss or WebLogic.

If you are going to use EJBs then you have no real reason to call servlets. Call the EJB directly from your swing controller.

This also fixes your problem of using HTTP as your communications to the EJB will use RMI. However you should make sure those ports are open on any firewall you may be using. I've been burned by that in the past when I didn't "own" the firewall.

Tom
[ March 17, 2005: Message edited by: Thomas Hubschman ]

SCJP '02, SCWCD '02, SCJD '08, SCSNB '09, SCEA '10
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web application