Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:useBean for member class  RSS feed

 
Mitch Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Started with examples from HF Chapter 8. 2 beans: Dog, Person

Person has a Dog.
Added constructor to Person which makes Dog, so getDog() is never null.

Created html to enter new Person, 2 fields: name, dogname
jsp to read form has:
<jsp:useBean id="person" class="foo.Person" scope="request">

How do I use jsp:useBean with param="dogname" to set Person.Dog.name?

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't; that's not the purpose of useBean,

Check out JSTL's <c:set> action.
 
Mitch Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
c:set was explained in following chapter.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!