Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem passing request to servlet

 
justin deming
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
Manjunath Reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummmm....need more data...some code snippent probably..
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic