• 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

Problem with bean:write tag

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

I'm working on struts 1.1 framework.

How can I pass an attributte tu a getter method like this??

<bean:write name"myBean" property="translation(lang).name" />

if I use

<bean:write name"myBean" property="translation(en).name" />

it works fine, but I need that the parameter to be non static...

Any idea???
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
Why not just use an EL expression? For example if you have a variable "lang" that contains the language string, you could simply write ${translation[lang].name}.

If your web application uses Servlet version 2.4, you can just use the EL expression anywhere in your JSP. Otherwise, you have to enclose it in a c:out tag. You can determine which version of the Servlet spec you're using by examining the DTD reference in your web.xml file.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic