Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I declare a bean that is a property of another bean?

 
Thomas Kennedy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Clapham
Sheriff
Pie
Posts: 20758
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic