This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes bean:define help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:define help" Watch "bean:define help" New topic

bean:define help

Alan Hermin
Ranch Hand

Joined: Feb 16, 2006
Posts: 290
hi all... i want to convert this script to struts <bean efine>

But this does not work.........
can any one help me...............
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In order to make this list available to Struts tags, you need to put it in a "scope" (application, session, request, or page). I would not use a bean:define tag for this. I'd use the following statement to put the list in page scope:

<% pageContext.setAttribute("list", list); %>

Once you have done this, you can use list in any struts tags. For example:

<logic:iterate id="element" name="list">
<bean:write name="element"/>
[ July 12, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
subject: bean:define help