File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem with bean:write tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with bean:write tag" Watch "Problem with bean:write tag" New topic

Problem with bean:write tag

Rafa Barcel� Bauz�

Joined: Aug 09, 2006
Posts: 22

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???
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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 cut tag. You can determine which version of the Servlet spec you're using by examining the DTD reference in your web.xml file.

Consultant, Sima Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: Problem with bean:write tag
Similar Threads
About html:link
How to pass parameters to javascript function on click of html:link
Displaying Data
Accessing javabean in JSP which is instantiated in Action class
Struts 1 :how to display collection