You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Curren <pc...@cisco.com> on 2003/04/26 09:19:11 UTC

with variable arguments

Hi there,

I'm having trouble using the <bean:message> tag with it's arguments.
Firstly, I have in the HttpServletRequest a List who's contents are a
bean i've created with a message key, and a List of of parameters values.

I want to output the messages represented by the message keys in my jsp
so have tried the following -

<logic:iterate id="progMsg" name="<%=
ProgressCheckAction.PROGRESS_MESSAGES %>"
                type="com.cisco.ettx.provisioning.progress.ProgressMessage"
                indexId="msgIndex">
             <bean:message name="progMsg" property="key"
                 arg0="<%= (String)progMsg.getParams().get(0) %>"
                 arg1="<%= (String)progMsg.getParams().get(1) %>"
                 arg2="<%= (String)progMsg.getParams().get(2) %>"
                 arg3="<%= (String)progMsg.getParams().get(3) %>"
                 arg4="<%= (String)progMsg.getParams().get(4) %>" />
</logic:iterate>

(I have arranged that the params property will always contain 5
arguments, even if it has to be padded.)

So the problem here is that the jsp <%= code is all evaluated prior to
the bean tag being evaluated, resulting I think in each iteration using
a <bean:message> where all the arguments have been replaced by the
parameters for the first progMsg in the iteration. i.e. each message
output uses the same parameters, which are the first from the iteration.

Can anyone suggest a better way of doing what i'm trying to do?

Cheers,

Paul C


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org