Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web application

 
ham rah
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Thomas Hubschman
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic