This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Process HTTP Response with Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Process HTTP Response with Servlet" Watch "Process HTTP Response with Servlet" New topic
Author

Process HTTP Response with Servlet

Jidlafe Santos Hegner
Greenhorn

Joined: Apr 27, 2009
Posts: 4
Good Morning, first forgive me becouse my bad ingles.
I Was born in Angola-africa, and I Study in Brazil. I am doing tests and Studing Java Web app
and I want know if hi cant get Some Input from User, catch with Servlet or Filter
send HTTP Request to another Web Server with Servlet, take the response HTTP (With headers, and...),
send to html or jsp page to my client. My app would be more or less middle.

Thanks, and forgive me becouse my bad ingles


I like Java, this the True.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41148
    
  45
Welcome to JavaRanch.

If you want to write an HTTP proxy yourself, this may be a good start.

Here's a list of existing proxies.


Ping & DNS - my free Android networking tools app
Jidlafe Santos Hegner
Greenhorn

Joined: Apr 27, 2009
Posts: 4
First Thanks for answer my question.
Well, I analyzed the problem and what I really want is
request http with Servlet, like client do and get the http response from
Web Server. This Web Server cant be another plataform, like IIS, and Apache (UNIX),
and it dont now on the existence of my Servlet

May be i fink is necessary do something with package.
am young in Java Devlopment and some time I feel lost.

I appreciate your mature details.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41148
    
  45
You can easily program an HTTP request using the various classes in the java.net package, but what is your servlet code going to do with the response of the server?

Also, the other server couldn't care less about your servlet - it looks just like any other client to it. So that shouldn't be a problem.
Jidlafe Santos Hegner
Greenhorn

Joined: Apr 27, 2009
Posts: 4
Hi,

I never did something like this and i canĀ“t find samples to do it. I understand that the java framework probably
can help me but, i am looking for something ready that helps me to edit the HTTP response coming from other pages. I need to catch a content
that comes from other website (the another website is outside from my server) and show inside my webpage informations
edited.

Somebody can please help me in how to do it whit Java?

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41148
    
  45
In the simplest case it could be something like e136 here. Note that you can pass GET parameters in the URL if necessary.
Jidlafe Santos Hegner
Greenhorn

Joined: Apr 27, 2009
Posts: 4
Thanks Ulf.
Now the examples are accurate. I can apply yet in my problem.

Thank you very much. ('');
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process HTTP Response with Servlet
 
Similar Threads
Transforming Servlet Response
Send Redirect
need help for cookies problem
Servlet Mapping, HTTP requests, and Error Handling
how to decouple sql in servlet