You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Fulgencio Comendeiro, Eduardo" <Ed...@getronics.com> on 2005/11/21 11:06:40 UTC
What's wrong
<%
{
java.util.ArrayList list = new java.util.ArrayList();
list.add("textouno.texto1");
list.add("textouno.texto2");
list.add("textouno.texto3");
list.add("textouno.texto4");
pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);
}
%>
<jsp:useBean id="list" scope="page" class="java.util.ArrayList" />
contenido.
<logic:iterate id="item" name="list" >
<input type="hidden" id='<bean:write name="item"/>'
value="<bean:message key='<bean:write name="item"/>'/>" >
</logic:iterate>
The result must be : <input ...... value="<bean:message
key='textouno.texto1' />" >
Re: What's wrong
Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/21/05, Fulgencio Comendeiro, Eduardo
<Ed...@getronics.com> wrote:
> <%
> {
> java.util.ArrayList list = new java.util.ArrayList();
> list.add("textouno.texto1");
> list.add("textouno.texto2");
> list.add("textouno.texto3");
> list.add("textouno.texto4");
> pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);
> }
> %>
<snip/>
Artificial scope might be unnecessary.
> <jsp:useBean id="list" scope="page" class="java.util.ArrayList" />
<snap/>
jsp:useBean is moot, given the scriptlet.
> contenido.
> <logic:iterate id="item" name="list" >
> <input type="hidden" id='<bean:write name="item"/>'
> value="<bean:message key='<bean:write name="item"/>'/>" >
> </logic:iterate>
>
> The result must be : <input ...... value="<bean:message
> key='textouno.texto1' />" >
>
>
<snip/>
JSTL? Along the lines of (JSP 2.0 variant) ...
<c:forEach var="item" items="${list}">
<input type="hidden" name="${item}" value="<bean:message key='${item}'/>" >
</c:forEach>
-Rahul
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org