• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to combine html:text and bean:write

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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">
 
reply
    Bookmark Topic Watch Topic
  • New Topic