Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Process HTTP Response with Servlet

 
Jidlafe Santos Hegner
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jidlafe Santos Hegner
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf.
Now the examples are accurate. I can apply yet in my problem.

Thank you very much. ('');
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic