Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

problem with html:text prpperty value=bean:write

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I want to show values in the text box for editing purpose. I'm able to get & show the value using <bean:write> tag. But i can't assign the value to text box. If i use like below code it's showing the full <bean:write> tag as String. <html:text property="userName" value='<bean:write name= "user" property="userName"/>'/>
pls help me regarding this.

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The whole point of using an html:text tag as opposed to <input type="text"> is so that the input element will be populated with the value of the corresponding property of the ActionForm bean. If you provide no value attribute, struts does this automatically.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Had the same problem as above. Tried various combinations of double and single quotes...but same error persisted. As Merrill suggested, removed the value attribute in the html:text tag and voila....the value the ActionForm already holding was displayed as default text in the html:text. Gr8.
And if we dont want to have any default text value to be displayed in the jsp, jus set the text property in the ActionForm to null, using the setter method.
Eg. user.setUserName(null); Or, can set the text property to null in the reset method.

Cheers!
 
What does a metric clock look like? I bet it is nothing like this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic