• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem passing request to servlet

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ummmm....need more data...some code snippent probably..
- satya
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic