Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Is there a way I can route http requests

Thread view: 
Janaka Perera - 07 Nov 2007 09:21 GMT
Hi All,

I have a servlet which works as a web service. In a one scenario, I
need to send the request i am getting from a client to another server
and send back the exact reply i am getting from the server to the
request client. Is there a way to do this or any libraries i should
look for.

Thank you

Janaka
derek - 07 Nov 2007 14:55 GMT
> Hi All,
> I have a servlet which works as a web service. In a one scenario, I
[quoted text clipped - 4 lines]
> Thank you
> Janaka

You could send a redirect.

http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletResponse.htm
l#sendRedirect(java.lang.String
)

Or do you want to do a proxy? Proxy would be more difficult.
Janaka Perera - 07 Nov 2007 18:02 GMT
> http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletR...)
>
> Or do you want to do a proxy? Proxy would be more difficult.

Actually what i wanted to do is calling the other server in the doPost
or doGet method and converting them into the HttpServletResponse. I
finally managed to do it using org.apache.commons.httpclient library.
Transfered the headrers and the body using some logic in the doGet
method to the HttpServletResponse from the #rd party server response.

Thank you very much for your help. sorry if my explanation earlier was
not clear.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.