• 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