This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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
I agree. Here's the link:
subject: Passing an HttpServletRequest object
Similar Threads
Reading parameters in Servlet passed from Client
Single Thread Model
can any tell what is passed to init() method...
Finding the type browser from Servlet