ServletRequest vs ServletResponse
Last modified on July 25th, 2014 by Joe.
ServletRequest and ServletResponse are two interfaces that serve as the backbone of servlet technology implementation. They belong to the javax.servlet package.
- Signature: public interface ServletRequest
Blueprint of an object to provide client request information to a servlet. The servlet container creates a ServletRequest object and sends it as an argument to the servlet’s service method.
- Signature: public interface ServletResponse
Blueprint of an object to assist a servlet in sending a response to the client. The servlet container creates a ServletResponse object and passes it as an argument to the servlet’s service method. Data that needs to be sent to the client will be put inside the ServletResponse object. To send binary data back to the client in a MIME body response, use the ServletOutputStream from the ServletResponse object by calling the getOutputStream() method. To send character data to the client, the PrintWriter object returned by getWriter() should be used.
very helpful information…
gud….i got more information about it.
thansss
I got useful information. Thank you sir…….
information is good and please also provide example it can make most eseare way to understand.
good .we need examples
very good very useful for biginners
thanks lot
please send simple example
today i attand the lacture of servlet and i con’t understand the diffrence b/n them but right now i understand.
so thank u sir.
very useful
thank you sir….
sir,
can you post some sample and simple examples…
please sir send exmaple sir explain in the request and response
please send simple exmaple sir explain in the request and response
Nice information very simple useful and understandable.