aspose file tools*
The moose likes Servlets and the fly likes about sending request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "about sending request" Watch "about sending request" New topic
Author

about sending request

sunanda kadam
Ranch Hand

Joined: Feb 26, 2008
Posts: 42
hello
I am doing one appliocation for sending one messege from my tomcat to other tomcat in LAN.
can i do this ?
please give me some hint .
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Sure. HTTP would seem simplest since both servers are obviously equipped to handle it, but many other options exist: Mail, JMS, shared file system, database, sockets, web service, ...


Ping & DNS - my free Android networking tools app
sunanda kadam
Ranch Hand

Joined: Feb 26, 2008
Posts: 42
can you tell me the link from where i'll get these details with examples ?
Through webservice how we can do ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Unless you have specific reasons to use WS, I'd resort to HTTP or raw sockets. Code examples for both can be found here. The Sun Java Tutorial also has an extensive chapter on networking.
sunanda kadam
Ranch Hand

Joined: Feb 26, 2008
Posts: 42
Thanks a lot Ulf.
sunanda kadam
Ranch Hand

Joined: Feb 26, 2008
Posts: 42
Through mail how can we do this ?
My application is client-server(request-response) type.
if suppose there 3 machines in network ,then they should communicate with each other ,having inbox(mail saved ) on their machines.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Obviously, there would need to be a mail server that all machines can access. The client access to that server can be handled using the JavaMail API.

I think that HTTP would be far easier to implement, though, and have other advantages (like synchronicity).
[ August 07, 2008: Message edited by: Ulf Dittmer ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

There is the Java Mail API for mail communication, but if you need to communicate among two servers (or a client and a server), then I think that HTTP is the best way

[edit]
Well Ulf said it before me although his post was not visible the time I posted.And since we both are saying the same thing then it must be right
[/edit]
[ August 07, 2008: Message edited by: Amit Ghorpade ]

SCJP, SCWCD.
|Asking Good Questions|
sunanda kadam
Ranch Hand

Joined: Feb 26, 2008
Posts: 42
Through http get & post methods we have to do it or other methods are used.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by sunanda kadam:
Through http get & post methods we have to do it or other methods are used.


I'm not sure what you are saying/asking here.
Was there something in an earlier post that you didn't understand?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Originally posted by sunanda kadam:
Through http get & post methods we have to do it or other methods are used.


There are many methods, like Ulf and the others have pointed out. You need to decide which one you want. What is it that you are trying to send ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about sending request