File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Relay request to another server Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Relay request to another server" Watch "Relay request to another server" New topic
Author

Relay request to another server

Madangopal Venkatesan
Greenhorn

Joined: Jun 19, 2011
Posts: 16
A request hits my server. I want to modify the request header and send the same request to another application outside my container. How do I do that?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

Start by taking the time to compose descriptive subjects for your posts. You will attract people who will can give you better and faster answers when your posts have good, descriptive subjects. For more information, please click this link ⇒ UseAMeaningfulSubjectLine.

Using a title such as "Help!" isn't going to attract the attention of those who can best help you.

I have modified your subject for you. Please use it as an example for future posts.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

You cannot send the same request instance to another server. You'll need to generate a new request. The classes in java.net can help, or you can use tools such as HttpClient.
Madangopal Venkatesan
Greenhorn

Joined: Jun 19, 2011
Posts: 16
I cannot create a new request as per the specifications given to me. I saw on some forums that this can be done at the container level (Tomcat) using Perl. Could you suggest how and could you also suggest any mechanisms by which this can be achieved?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

A specification that asks for the impossible cannot be met. There may be some way to relay a request at lower levels in the IP stack, but at the servlet level, it cannot be done.

I'll move this post along to the Protocols forum.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Relay request to another server
 
Similar Threads
Color Codes Needed .
How to fill color for applet background??
Calling a Hashtable from another class.
How to increase number of parellel ajax hits from same user!!
System exception on UserTransaction.commit() , followed by RollbackException