What is the getInputStream() of ServletRequest for?
The getInputStream() can be used to retrieve the body of http post request as raw binary data by using a ServletInputStream. It works only for http post request. Either this method or getReader() may be called to read the body of post request, not both.
The getParameter() gets the value of a request parameter as a String, or null if the parameter does not exist. If you use getParameter first, you will not get inputstream by calling getInputStream or a buffer reader by getReader().
Most Recent servlet Faqs
- What is the getInputStream() of ServletRequest for?
- How to get the client information in a Servlet?
- Can I control Session timeout?
- What is the difference between RequestDispatcher's forward method and HttpServletResponse's sendRedirect method?
- When do I use HttpSessionListener?
- What is the difference between the request attribute and request parameter?
- What is the defferent between getNamedDispatcher() and getRequestDispatcher()?
Most Viewed servlet Faqs
- What is the difference between the request attribute and request parameter?
- When do I use HttpSessionListener?
- How to use ServletContext.getResourceAsStream(java.lang.String path)?
- What is the difference between RequestDispatcher's forward method and HttpServletResponse's sendRedirect method?
- Can I control Session timeout?
- How to get the client information in a Servlet?
- What is the defferent between getNamedDispatcher() and getRequestDispatcher()?