| Author |
bean:define error - Cannot find bean in scope null
|
Si Smith
Greenhorn
Joined: Apr 27, 2009
Posts: 5
|
|
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
Joined: Apr 27, 2009
Posts: 5
|
|
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
Joined: Feb 19, 2008
Posts: 2896
|
|
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.]
|
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
|
 |
Shailesh Narkhede
Ranch Hand
Joined: Jul 10, 2008
Posts: 356
|
|
|
are you forwarding to JSP directly OR using tiles of struts framework?
|
Thanks,
Shailesh
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: bean:define error - Cannot find bean in scope null
|
|
|