• 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

bean:define with bean:write

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"/>
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this

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

-HTH
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
or:
<bean:write name="userForm" property="userId" />

or maybe:
<c:out 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to both of you, now let me try the code.
 
reply
    Bookmark Topic Watch Topic
  • New Topic