This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem passing request to servlet