struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Moore <Howard.Mo...@datapulse.com>
Subject RE: BeanMessage Tag proposal
Date Mon, 19 Mar 2001 14:32:54 GMT


> -----Original Message-----
> From: Johan Compagner [mailto:jcompagner@j-com.nl]
> Sent: 19 March 2001 13:36
> To: struts-dev@jakarta.apache.org
> Subject: Re: BeanMessage Tag proposal
> 
> 
> Yes prefect
> And you mean by argX:
> 
> <bean:message key="foo.bar" name="aBean" argx="argX"/>
> 
> and argX returns a ArrayList of all the arguments there are.
> Prefect solution got my vote!!

Actually argX was shorthand for the attributes arg0, arg1, arg2, arg3 and
arg4. I rarely need more that one or two arguments and these are typically
simple string properties of the form bean. What I would like to avoid is
having to put them into an array or list just to display them. Of course
there is no reason why the tag couldn't support this as well.

 
> 
> johan
> 
> ----- Original Message ----- 
> From: "Howard Moore" <Howard.Moore@datapulse.com>
> To: <struts-dev@jakarta.apache.org>
> Sent: Monday, March 19, 2001 10:40 AM
> Subject: RE: BeanMessage Tag proposal
> 
> 
> > I would also like a similar change but would prefer it if the 'argX'
> > variables also worked with the defined bean. 
> > 
> > For example it would be nice if I could replace something like this:
> > 
> > <bean:message key="foo.bar" arg0="<%= aBean.getArg0()%>"/>
> > 
> > with this:
> > 
> > <bean:message key="foo.bar" name="aBean" arg0="arg0"/>
> > 
> > If the name attribute is not present the tag would still work as it
> > currently does.
> > 
> > 
> > > -----Original Message-----
> > > From: Johan Compagner [mailto:jcompagner@j-com.nl]
> > > Sent: 16 March 2001 12:50
> > > To: Struts-User; Struts-Dev
> > > Subject: BeanMessage Tag proposal
> > > 
> > > 
> > > Hi,
> > > 
> > > When setting the args (arg0,arg1,arg2,arg3,arg4)
> > > you must do this:
> > > <bean:message key="foo.foo.foo" arg0="foo1" arg1="foo2"/>
> > > 
> > > But i think it is very rare that you know exactly at design 
> > > time of the jsp
> > > what value there must be. Because if you do then why not set 
> > > it directly in
> > > the message it self?
> > > 
> > > So it is almost any time a runtime expression.
> > > But then i must do things like this:
> > > 
> > > <bean:define id="argstring1" value="totalautotheft"/>
> > > <bean:define id="argstring2" value="autotheft"/>
> > > <bean:define id="insurance" name="carinsurance" scope="session"
> > > type="nl.topicus.thema.DynamicForm"/>
> > > <bean:message key="prompt.advise.wacasco" arg0="<%=
> > > insurance.getProperty(argstring1).toString() %>" arg1="<%=
> > > insurance.getProperty(argstring2).toString() %>"/>
> > > 
> > > 
> > > I must define
> > > <bean:define id="argstring1" value="totalautotheft"/>
> > > because i can't do this:
> > > <bean:message arg0="<%= 
> > > insurance.getProperty("totalautotheft").toString()
> > > %>"
> > > 
> > > I find this a bug of the Tomcat parser if you ask me. Because 
> > > if he sees
> > > that it is a reqexpr (<%=)
> > > then it should first find the %> before looking at the closing "!!
> > > 
> > > Because if these problems i wanted to find a solution
> > > Why is is not possible that i get the Object[] from a 
> name/property???
> > > Then the BeanTag is also not limmited to only 5 args
> > > 
> > > My example for the above one:
> > > 
> > > <app:message key="prompt.advise.wacasco" (arg)name="insurance"
> > > (arg)property="wacascoObjects"/>
> > > 
> > > and the insurance.getWacascoObjects() does return the 
> > > Object[] for that
> > > string:
> > > object[0] = insurance.getProperty("totalautotheft");
> > > object[1] = insurance.getProperty("autotheft");
> > > return object;
> > > 
> > > Johan Compagner
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> 

Mime
View raw message