• Post Reply Bookmark Topic Watch Topic
  • New Topic

getAttribute in jsp is returning null.  RSS feed

 
sanjeetha ashiqa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ankit Garg
Sheriff
Posts: 9609
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
sanjeetha ashiqa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ankit.
It worked!!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65898
135
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recall that request *attributes* are not the same as request *parameters*.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!