Information About ServletResponse Interface and Their Initiation Methods in Java.


This resource contain the information about ServletResponse Interface in Java.

ServeltResponse Interface


It is used to generate output for the client.
The methods of ServeltResponse Interface is:-
1. Void setConType(String ContentType)
This method is used to set the content type according to which output is redirected back to the client.

2. ServletOutputStream getOutputStream() throws IllegelState Exception, IOException
This method is instantiated the object of Servlet OutputStream class type. The Servlet OutputStream object also helps to write the binary data back to the client. Servlet OutputStream class inherits java.io.outputStream class.

3. PrintWriter getWriter() throws IllegalStateException
This method is instantiated the object of java.io.PrintWriter class. This method may throw IllegalStateException, If the getOutputStream method is already invoke by the servletResponse object.


Comments



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: