Sunday, December 24, 2017

Commonly used method of ServletRequest interface

1- getParameter():
                              Is used to obtain the value of request parameter.
    public String getParameter(String pName);

2- getParameterNames():                          
                               Is used to find out names of request parameters.
    public Enumeration getParameterNames();

3- setAttribute():
                                Is used to store an attribute in the request scope.
    public void setAttribute(String name, Object Attribute);

4- getAttribute():
                                Is used to obtain the value of an attribute.
    public Object getAttribute(String name);

5- getAttributeNames():
                  Is used to obtain the names of attribute store in request scope.
    public Enumeration getAttributeNames();

6- removeAttribute():
                              Is used to remove an attribute from the request scope.
    public void removeAttribute(String name);

7- getInputStream():
                  Is used to obtain an InputStream to read request data.
    public InputStream getInputStream();



Note:
getParameter             Textual Information (such as Name, Password)
getInputStream         For file uploading program, video, Audio, Large file


No comments:

Post a Comment

Java Functional Interface

Java Lambda expression Lambda expression came to enable to use functional programming feature in java. It provides the facility t...