Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to populate a bean in a form?

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I would like to populate an object's (bean) info into my form.

can anyone assist what the code should be look like???

I have this:



the bean is in this format:
<bean:write name="empl" property="name" />

thanks

PS:
I know I can simply populate the form from the action prior to this page, but this isn't the case since the page is a composition of couple of pages.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
value= "what should be written here???"


Answer: nothing

You shouldn't code a value attribute at all. The <html:text> tag automatically uses the value of the actionform property you specify.
I know I can simply populate the form from the action prior to this page, but this isn't the case since the page is a composition of couple of pages.

Whether the page is a composition of pages is irrelevant. The correct place to set the ActionForm property is in an Action class that forwards to this JSP. If this page is part of a tiles definition, that's fine. You can still populate the ActionForm prior to the page being displayed.
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well the problem occurred when I placed the fw in a composition page:

original (worked OK)


the fw I replaced was this


and it doesn't work. I assumed it's because of the page composition.
any idea?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic