It's not a secret anymore!
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
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: 3226
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
jQuery in Action, 3rd edition