| Author |
How do I declare a bean that is a property of another bean?
|
Thomas Kennedy
Ranch Hand
Joined: Jan 20, 2008
Posts: 137
|
|
In my view I have this
In my JSP I have this:
Of course I will replace the scriplet:
but it would be nice to do this instead:
How can I declare a bean that is itself a property of another bean?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
I think it's needless, but you can simply create a new scoped variable for foo in your controller. Though I don't see what the advantage is. In fact, it becomes less clear when you do that. I'd simply keep the original references.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
I don't know about "declare"... you could certainly put the Foo object into request scope in your controller code identified as "foo", and then you could use
in your JSP.
|
 |
 |
|
|
subject: How do I declare a bean that is a property of another bean?
|
|
|