- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which methods can be used to read HTTP header in your JSP program.
The request object provides methods to get HTTP header information including form data, cookies, HTTP methods, etc.
Following table lists out the important methods that can be used to read HTTP header in your JSP program. These methods are available with HttpServletRequest object which represents client request to webserver.
|Sr.No.||Method & Description|
Returns an array containing all of the Cookie objects the client sent with this request.
Returns an Enumeration containing the names of the attributes available to this request.
Returns an enumeration of all the header names this request contains.
Returns an enumeration of String objects containing the names of the parameters contained in this request.
Returns the current session associated with the this request, or if the request does not have a session, creates one.
|6||HttpSession getSession(boolean create)|
Returns the current HttpSession associated with the this request or, if if there is no current session and create is true, returns a new session.
Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.
|8||Object getAttribute(String name)|
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
Retrieves the body of the request as binary data using a ServletInputStream.
Returns the name of the authentication scheme used to protect the servlet, for example, "BASIC" or "SSL," or null if the JSP was not protected.
Returns the name of the character encoding used in the body of this request.
Returns the MIME type of the body of the request, or null if the type is not known.
Returns the portion of the request URI that indicates the context of the request.
|14||String getHeader(String name)|
Returns the value of the specified request header as a String.
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
|16||String getParameter(String name)|
Returns the value of a request parameter as a String, or null if the parameter does not exist.
Returns any extra path information associated with the URL the client sent when it made this request.
Returns the name and version of the protocol the request uses.
Returns the query string that is contained in the request URL after the path.
Returns the Internet Protocol (IP) address of the client that sent the request.
Returns the fully qualified name of the client that sent the request.
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
Returns the session ID specified by the client.
Returns the part of this request's URL that calls the JSP.
|26||String getParameterValues(String name)|
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.
|29||int getIntHeader(String name)|
Returns the value of the specified request header as an int.
Returns the port number on which this request was received.
- How to read a HTTP header using JSP?
- Which library can be used to interact with database in JSP?
- How can you read a request header information in JSP?
- Which MySQL Data Type can be used to store Negative Number?
- Why can't Java generics be used for static methods?
- Can somebody explain the HTTP headers in simpler terms in JSP context?
- What are important HTTP headers to be frequently used in Python CGI Programming?
- What are the curries in which cinnamon can be used to improve the taste?
- How to read cookies with JSP?
- Which MySQL query can be used with the help of which we can see the list of MySQL databases?
- How can I create custom tag in JSP which can accept attribute from parent jsp page?
- How can Tensorflow be used to export the model so that it can be used later?
- Which punctuation character can be used as the delimiter between MySQL date parts?
- Which punctuation character can be used as the delimiter between MySQL time parts?
- What is the maximum size of HTTP header values?