Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is purpose of HttpResponse

 
kajal mukergi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we never use it any where
for example what ever we do

we do like request.set or .....

but where we actually use the response object at all

especially in doPost(......,HttpResponse ) and also in execute()in struts....

please clarify....

or provide me the details of Response obj.....
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That all depends what you want to do with the servlet.
You can get print writer from response to write out stuffs in the HTTP response.
Apart from this there are many other uses of HTTP response.Check with the api for detail.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i think you might not have realised many of the default and required actions like,

response.getWriter() - to get a writer handle to write it back to the client via a response.

response.setContentType("text/html"); - a must one to set the content type before actually dumping your response content into it

You can also browse the APIs and google it for some sample programs which speaks beyond these aspects.
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'ts really important and it does get used.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as Marcus Green pointed out, its equally important to that of request.

Always the {request,response} pair have equal significance/importance in the paradigm.
[ June 06, 2007: Message edited by: Raghavan Muthu ]
 
kajal mukergi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok friends
thank you very much.....



response.getWriter() - to get a writer handle to write it back to the client via a response.

response.setContentType("text/html"); - a must one to set the content type before actually dumping your response content into it

i know 1st one
but secound i have to try...
thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic