Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Relay request to another server

 
Madangopal Venkatesan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic