Where is servletrequest implemented
Pablo Lozano Pablo Lozano 9, 2 2 gold badges 35 35 silver badges 58 58 bronze badges. But we have HttpServletRequestWrapper. What is the usage of ServletRequestWrapper? Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Featured on Meta. Now live: A fully responsive profile.
Follow us! Get the Latest Bytes Updates. By using this site, you agree to our Privacy Policy and Terms of Use. Mar 19 '10 Follow Post Reply 0 Message. Cancel Changes. Java ServletRequest. NET Framework interface, implementation, and visibility 8 posts views Thread by khalprin last post: by. General hadr monitor script reply views Thread by suresh last post: by. General The research path of clustering reply views Thread by goatbishop last post: by.
Career Advice Do you think a 50 year old male with no degree can still become a coder? General add 1 month to date reply views Thread by bytM3 last post: by. Career Advice Software Engineering Bootcamps worth consider? String getRemoteHost Returns the fully qualified name of the client or the last proxy that sent the request. RequestDispatcher getRequestDispatcher java. String path Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. String getScheme Returns the name of the scheme used to make this request, for example, http , https , or ftp.
String getServerName Returns the host name of the server to which the request was sent. String name Removes an attribute from this request. String name, java. Object o Stores an attribute in this request. String env Overrides the name of the character encoding used in the body of this request. AsyncContext startAsync Puts this request into asynchronous mode, and initializes its AsyncContext with the original unwrapped ServletRequest and ServletResponse objects.
AsyncContext startAsync ServletRequest servletRequest, ServletResponse servletResponse Puts this request into asynchronous mode, and initializes its AsyncContext with the given request and response objects. Method Detail getAttribute java. Attributes can be set two ways. The servlet container may set attributes to make available custom information about a request. XCertificate can be used to retrieve information on the certificate of the client. Attributes can also be set programatically using ServletRequest setAttribute.
This allows information to be embedded into a request before a RequestDispatcher call. Attribute names should follow the same conventions as package names. This specification reserves names matching java. Parameters: name - a String specifying the name of the attribute Returns: an Object containing the value of the attribute, or null if the attribute does not exist getAttributeNames java.
This method returns an empty Enumeration if the request has no attributes available to it. Returns: an Enumeration of strings containing the names of the request's attributes getCharacterEncoding java.
This method returns null if the request does not specify a character encoding Returns: a String containing the name of the character encoding, or null if the request does not specify a character encoding setCharacterEncoding void setCharacterEncoding java. String env throws java. UnsupportedEncodingException Overrides the name of the character encoding used in the body of this request.
This method must be called prior to reading request parameters or reading input using getReader. Otherwise, it has no effect. Parameters: env - String containing the name of the character encoding. Throws: java. UnsupportedEncodingException - if this ServletRequest is still in a state where a character encoding may be set, but the specified encoding is invalid getContentLength int getContentLength Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.
Returns: an integer containing the length of the request body or -1 if the length is not known getContentType java. Either this method or getReader may be called to read the body, not both. Returns: a ServletInputStream object containing the body of the request Throws: IllegalStateException - if the getReader method has already been called for this request java.
IOException - if an input or output exception occurred getParameter java. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data. You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues java. If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.
If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream or getReader can interfere with the execution of this method. Parameters: name - a String specifying the name of the parameter Returns: a String representing the single value of the parameter See Also: getParameterValues java. String getParameterNames java. If the request has no parameters, the method returns an empty Enumeration.
0コメント