• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getAttribute in jsp is returning null.

 
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: 9578
33
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
Pie
Posts: 65335
97
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*.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic