Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

problem with html:text prpperty value=bean:write

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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!
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!