HttpServletRequest « Request « JSP-Servlet Q&A

1. Is it possible to add to the available parameters of a request (HttpServletRequest)

I want to intercept a request in a filter/servlet and add a few parameters to it. However, the request does not expose a 'setParameter' method and the parameter map when manipulated ...

2. Modify HttpServletRequest body

I'm working on legacy code and need to make a patch. The problem: an ancient application sends bad HTTP POST requests. One of the parameters is not URL encoded. I know that ...

3. How the attribute field of a HttpServletRequest maps to a raw HTTP request?

In Java, the attribute field of a HttpServletRequest object can be retrieved using the getAttribute method:

String myAttribute = request.getAttribute("[parameter name]");
Where the HttpServletRequest attribute data is stored in a raw HTTP request? ...

4. Can I intercept and change the request url of a HTTPServletRequest within a Java Servlet filter?

I have a Java web application which manages data for many clubs. I would like the application to show club information depending on the URL that is typed in. Eg. If you ...

5. Get the HttpServletRequest (request) object from Java code

Hey guys, this is probably a very beginner level question. But I need to get hold of the request object in Java code. I can't pass this object down to my ...

6. jsp:setProperty request HttpServletRequest An exception occurred processing JSP page /Purchase.jsp

I have the following java and jsp. I get "org.apache.jasper.JasperException: An exception occurred processing JSP page /Purchase.jsp at line 41", that is the line with :"cart.processRequest(request);". Any idea please?

<!-- ShowSession.jsp -->
<%@page ...

7. HttpServletRequest.getRemotePort() returns different port per http request received on same machine?

I need to identify the remote ip and port of the clients that register to my service. Also, when the client web app goes down it un-registers itself from my web ...

8. How do you represent all of the parameters (names & values) contained in a HttpServletRequest object as a single string?

Is there some way to get all of the parameters contained in a HttpServletRequest object into a single String?

9. Get URL of the request sender with HttpServletRequest

How do you get the source domain using HttpServletRequest? Source domain is the requester's domain. Thanks.

10. Get the POST request body from HttpServletRequest

I am trying to get the whole body from the Httpservlerequest object. The code I am following is like this :

if ( request.getMethod().equals("POST") )
    StringBuffer sb = new StringBuffer();

11. HttpServletRequest request = NULL

12. HttpServletRequest request size