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

how to combine html:text and bean:write

 
surendar prabu
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My view is a jsp page which has a table whose fields are text boxes. each cell in the table is a text box. now i want present them with an initial value that i have retrieved from data base.

can i have

<html:text property="author" value= <bean:write id="" property="">

the bean tag is populated by a collection that is available in my actionform.

my code is working with
<input type=text value="<bean:write name='bookForm' property='author' />">

please tell me can i have the same with <html:text>
 
Shilpa Tendulkar
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , if your form elements are associate with bean, then value of those elements will be populated directly. you dont have to specify the value.
You just have to use:
<html:form action="someaction" name="formbean">
<html:text property="propname"/>
</html:form>
[ August 18, 2006: Message edited by: Shilpa Tendulkar ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this situation, you would want to use "indexed properties". Here is a link explaining how indexed properties work. Also see this thread.
 
surendar prabu
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shilpa and merill.

But, in this

<html:form action="someaction" name="formbean">
<html:text property="propname"/>
</html:form>

the <html:form> tag does not have "name" attribute.
this is resolved by the <logic:iterate name="formbean">
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic