It's not a secret anymore!*
The moose likes Servlets and the fly likes problem passing request to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem passing request to servlet " Watch "problem passing request to servlet " New topic
Author

problem passing request to servlet

justin deming
Greenhorn

Joined: Jul 18, 2001
Posts: 6
Hi,
I'm trying to pass a request, whose parameters are stored in a bean, to a servlet via:
<jsp:forward page="servlet/.../">
The bean has a scope of "session" but when I try to retrieve the request attributes from the servlet I get null, when I know there are objects stored in the request.
How can I make the servlet recognize the session and it's request objects?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040


The bean has a scope of "session" but when I try to retrieve the request attributes from the servlet I get null, when I know there are objects stored in the request.

When you are putting the beans on the session, why are you looking on the request?
Am I reading wrongly?
I am not clear, the way it is stated, could you please clarify.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Manjunath Reddy
Ranch Hand

Joined: Jul 26, 2001
Posts: 60
In all probability you are putting into the request parameters and trying to read attributes. This is the most often confused case with me.
Make sure that you are reading the parameters with request.getParameter("parameterName") and NOT request.getAttribute("parameterName").
If this doesnt solve...shed some more light on the issue.
cheers,
mpr
justin deming
Greenhorn

Joined: Jul 18, 2001
Posts: 6
I should not have mentioned the beans. The problem is that I am trying to pass a request to a servlet and the servlet says the request object is null.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Ummmm....need more data...some code snippent probably..
- satya
 
Don't get me started about those stupid light bulbs.
 
subject: problem passing request to servlet
 
Similar Threads
how to deal with session if you have both servlet and EJB ?
passing parameter from non JSF URL to JSF backing bean
Servlet --> Jsp with beans
JSP Queries
Binding user objects to request,session,pagecontext, application