Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:define with bean:write

 
chiragpatel Patel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to do something like below, if i run following code it prints as it is, dont print value of userId. Then how to do.

<bean efine id="abc" value='<bean:write name="userForm" property="userId"/>' />
<bean:write name="abc"/>
 
Ranjit Gopinathan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this

<bean: define id="abc" name="userForm" property="userId" />
<bean:write name="abc"/>

-HTH
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or:
<bean:write name="userForm" property="userId" />

or maybe:
<cut value="${userForm.userId}" />

BTW, the original problem is that you cannot nest tags inside the attributes of other tags. You probably could have written your orignial code like this as well:
<bean:define id="abc"><bean:write name="userForm" property="userId"/></bean:define>
<bean:write name="abc"/>

- Brent
[ September 18, 2007: Message edited by: Brent Sterling ]
 
chiragpatel Patel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of you, now let me try the code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic