Information About ServletRequest Interface and Their Initiation Methods in Java.

This resource contain the information about ServletRequest Interface in Java.

ServletRequest Interface

The object of this interface holds the data and information of the client. This is called the Servlet page. It can also retrieve the html form data of the previous page.
Methods of ServletRequest Interface :-
1. String getParameter (String htmlControlname)
This method Returns the value against html control name given in the agreement.

2. String [] getParameter value (String html/control/name)
This method is used in case of checkbox control.

3. String getContentType()
This method returns ContentType of the request made by the client. The ContentType are reserved by the value in Java.

4. Int getContentLength ()
This method returns size of data set by client. It may return -1 size of data that is not determined.

5. ServletInputStream getInputStream () throws IllegalStateException, IOException.
This method is instantiated the object of servlet InputStream class type. The ServletInputStream object can also used to read the binary data. This class inherits class.

6. Void setAttribute (String value)
This method is used to create variables that are used in Servlet pages which are accessed in the same context.

7. Java.lang.object getAttribute(String key)
This method is used to retrieve a value against the key which is created using set Attribute method.

View more information about Servlet in JavaServlet in Java


  • 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: