wood burning stoves 2.0*
The moose likes Servlets and the fly likes why service() accepts HttpServletResponse 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 "why service() accepts HttpServletResponse" Watch "why service() accepts HttpServletResponse" New topic
Author

why service() accepts HttpServletResponse

vianyrajnish rajnish
Ranch Hand

Joined: Apr 22, 2007
Posts: 70
hi,

i like to know .. why service() accepts httpservletrequest and httpservletresponse both ....when only httpservletrequest is enough..?



please reply me anyone

thanks,
vinay rajnish
Vishal Matere
Ranch Hand

Joined: Jan 22, 2008
Posts: 81
Because service() ultimately calls doGet()/doPost() methods which needs response object to send response to client.

Alternatively user can overide service() method and can write his own code to return response.

HTH


SCJP <br />SCWCD <br />SCBCD <br />SCEA-1
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60797
    
  65

If the request is "enough" how would you propose that a servlet writes output to the response and/or set headers?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why service() accepts HttpServletResponse
 
Similar Threads
Struts and Webservices
Question: why wrong super.service( (ServletRequest) req, (ServletResponse) res)
service method in HttpServlet
How container Handle request
HttpServletRequestWrapper