A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Servlets
Author
why service() accepts HttpServletResponse
vianyrajnish rajnish
Ranch Hand
Joined: Apr 22, 2007
Posts: 70
posted
May 21, 2008 09:36:00
0
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
posted
May 21, 2008 09:38:00
0
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: 56168
13
I like...
posted
May 21, 2008 09:38:00
0
If the request is "enough" how would you propose that a
servlet
writes output to the response and/or set headers?
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://zeroturnaround.com/jrebel
subject: why service() accepts HttpServletResponse
Similar Threads
HttpServletRequestWrapper
Question: why wrong super.service( (ServletRequest) req, (ServletResponse) res)
Struts and Webservices
service method in HttpServlet
How container Handle request
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter