File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes request.setAttribute and request.getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "request.setAttribute and request.getParameter" Watch "request.setAttribute and request.getParameter" New topic
Author

request.setAttribute and request.getParameter

Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51
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

Joined: Sep 29, 2008
Posts: 12617

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request.setAttribute and request.getParameter