Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:write inside html:text

 
Mark Butcher
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Not able to display values with <bean:write> inside <html:text> using Struts 1.3

Here is the code :
Action Class
--------------

JSP Code
-----------


Thank you.
Mark
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot use a custom tag as the attribute value of another custom tag.
 
Mark Butcher
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay.....but an alternative would really help me.
 
Karthik Jayachandran
Ranch Hand
Posts: 91
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Butcher wrote:Okay.....but an alternative would really help me.


Try iterating using JSTL tags
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Butcher wrote:Okay.....but an alternative would really help me.

I would be using JSTL and EL rather than proprietary tags. The EL can be used as attribute values.
 
Junilu Lacar
Bartender
Posts: 7572
52
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you could use the version of the Struts tags that work with EL: http://struts.apache.org/1.x/struts-el/tagreference.html#struts-html-el.tld
 
Mark Butcher
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would really appreciate an example.
Thanks.
 
Gopakumar Naryanan
Ranch Hand
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<HTML:text property='name' value='${emp.name}></html:text> where property is your formbean property and value is what you were trying to put in bean:write tag emp is bean name and name is the property.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic