This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:define error - Cannot find bean in scope null

 
Si Smith
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an action where I set an attribute in the request.

I then use a forward to get to the JSP that displays the outcome of the action.

In the JSP I can get to the attribute in the request using



However I would much rather use bean:define to get to my request attribute. Unfortunately I can't seem to find it.
If I use

the text "PRESENT!" is not output.

When I try to define the bean using



When I try to use the bean DocumentList, I get the error that the bean documentList cannot be found in scope null

What am I doing wrong for the documentList bean to not be found?

Thanks,
Simon
 
Si Smith
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what is confusing me the most with this is that I am able to get to the request attribute in Java but when I try to use struts bean:define to create a bean in the JSP using the request attribute, it doesn't seem to be able to find it.

Can anyone point me in the right direction?

Regards,
Simon
 
Sagar Rohankar
Ranch Hand
Posts: 2905
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Si Smith wrote:
the text "PRESENT!" is not output.

I don't know whether this works or not, but try using "parameter" attribute


Si Smith wrote:
When I try to define the bean using

When I try to use the bean DocumentList, I get the error that the bean documentList cannot be found in scope null
What am I doing wrong for the documentList bean to not be found?

<bean:define.../> is mainly used if you want to define a bean for a given scope, but from your example I don't think that its bean, its an instance of "List" class. So to make an individual bean from this "list" object, you need to iterate over this list, something like this



[Please check the basic "attributes" for "iterate" & "write" tags from Struts sites.]

 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you forwarding to JSP directly OR using tiles of struts framework?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic