This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Servlets and the fly likes Passing an HttpServletRequest object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing an HttpServletRequest object" Watch "Passing an HttpServletRequest object" New topic

Passing an HttpServletRequest object

Joe McGuire
Ranch Hand

Joined: Mar 19, 2001
Posts: 293
I've got a servlet that passes the HttpServletRequest "req" to a utility class that is to extract the parameters (using the req.getParameter( "parametername" ) method, and build an http page using those parameters.
For some reason, the req object being passed is empty (or it may be that the parameters cannot be passed this way?). Can the HttpServletRequest be used outside the servlet like this?
Tony Alicea

Joined: Jan 30, 2000
Posts: 3222
I don't see why not. Is the "req" inside the utility class null or just the params?

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
It is sorta covered in the JavaRanch Style Guide.
subject: Passing an HttpServletRequest object