This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request.setAttribute and request.getParameter

 
Songezo Nkukwana
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any reason why getParameter() returns null after setAttribute?





This always returns null? I added


to test and the result was null ... Is setAttribute only for objects not fields?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't a Struts question.

You can only put objects into scope, but in Java 5+ they'll be auto-boxed.

More importantly, attributes aren't the same as parameters. You're setting an attribute, and getting a parameter.
[ December 10, 2008: Message edited by: David Newton ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic