aspose file tools*
The moose likes Struts and the fly likes getAttribute in jsp is returning null. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getAttribute in jsp is returning null." Watch "getAttribute in jsp is returning null." New topic
Author

getAttribute in jsp is returning null.

sanjeetha ashiqa
Greenhorn

Joined: Mar 11, 2010
Posts: 9
HI,

I am implementing a web application using struts.

In my jsp page <%= request.getAttribute("filename")%> is returning null.
filename is the property in my form.

can anyone suggest any idea as of why this is happening and how i can rectify it??

Thank you.


Ashiqa
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

If filename is a property in your FormBean, then you can access it as
${beanName.filename}
here beanName is the name of your FormBean declared in struts-config.xml...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
sanjeetha ashiqa
Greenhorn

Joined: Mar 11, 2010
Posts: 9
Thanks Ankit.
It worked!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Recall that request *attributes* are not the same as request *parameters*.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getAttribute in jsp is returning null.