On 8/29/05, Levieux Cedric <[EMAIL PROTECTED]> wrote:
> 
> Hi James,
> 
> I don't know why you are so sarcastic but there is another solution ...
> giving via nested tags the arguments like that
> 
> <bean:message key="myKey">
> <bean:messageArgument>what you want as first argument (i.e 0
> one)</bean:messageArgument>
> <bean:messageArgument>what you want as second
> argument</bean:messageArgument>
> <bean:messageArgument name="myObject" property="myProperty"
> format="dateFormatForExample"/>
> </bean:message>
> 
> This is what I propose in my previous post with some code in attachment.


You can already do that by using JSTL instead of the Struts tags:

<fmt:message key="...">
<fmt:param value="..."/>
</fmt:message> 

--
Martin Cooper


Regards,
> 
> Cedric
> 
> 
> ----- Original Message -----
> From: "James Mitchell" <[EMAIL PROTECTED]>
> To: "Struts Developers List" <dev@struts.apache.org>
> Sent: Monday, August 29, 2005 10:26 PM
> Subject: Re: Some thoughts.
> 
> 
> 
> I'm glad you asked ;)
> 
> arg0Name?
> arg0Property?
> 
> Why not also add arg0NameKey and arg0PropertyKey, so I can put them
> in the bundle for better reuse?
> 
> Oh wait! I'm not done. Since they are in a different bundle, we
> also need to be able to specify a bundle key...
> 
> arg0BundleKey
> 
> So...
> <bean:message key="msg.hello"
> arg0Name="user"
> arg0Property="userName"
> arg0BundleKey="customer"
> arg1Name="accts"
> arg1Property="accounts.totalOfActiveAccounts"
> arg1BundleKey="accounts"
> arg2Name="accts"
> arg2Property="accounts.totalBalance"
> arg2BundleKey="accounts"/>
> 
> ...that's almost perfect. Only problem is my boss just told me to
> add 3 more things to the welcome message, so can we make this tag
> take 10 arguments?
> 
> <back-to-reality/>
> 
> Where does this end? The term 'slippery slope' comes to mind here.
> 
> There is a point where enough is enough. And that's why Struts has
> been so successful. Guided by the likes of Craig and friends,
> knowing when to say 'no' is what separates Struts tags from some of
> the other whiz-bang-do-it-all tags that have come and gone.
> 
> I think the one enhancement I would have liked to see is the ability
> to specify a map of strings that get appended as attribute="value" to
> any tag (specifically, for me, the form tag). Other than that I am
> perfectly happy using what we have.
> 
> For the above example, you could just as easily put this message
> together in your Action, and add it as a request attribute, and
> simply write it out. No need for a scriptlet. No changes needed to
> your form bean. Same effect, a lot less effort.
> 
> Thanks.
> 
> 
> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> http://www.edgetechservices.net/
> 678.910.8017
> AIM: jmitchtx
> Yahoo: jmitchtx
> MSN: [EMAIL PROTECTED]
> Skype: callto://jmitchtx
> 
> 
> 
> 
> On Aug 29, 2005, at 1:37 PM, Leon Rosenberg wrote:
> 
> >
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> >> Gesendet: Montag, 29. August 2005 18:15
> >> An: Struts Developers List
> >> Betreff: Re: Some thoughts.
> >>
> >> James Mitchell wrote:
> >>
> >>> Well, the taglibs are more or less feature complete. So
> >>>
> >> any changes
> >>
> >>> are really "extensions" or "nice-to-have".
> >>>
> >>
> >> I think this is the part of the equation I don't necessarily agree
> >> with... I think saying they are feature-complete in terms of what
> >> they
> >> were meant to be years ago *is* accurate.
> >> They do what was set out to provide,
> >>
> >
> >
> > After some reasoning, I must say that I must disagree with James
> > statement.
> > A very simple example. I need to greet the user in his language.
> > I will help a message like this in my messages_en.properties:
> > msg.hello=Hello {0}
> > And in messages_de.properties
> > msg.hello=Hallo {0}
> >
> > Now I have my page, the right locale and the user object. Without
> > EL, how
> > can I ever right the proper greeting?
> > The only way today would be:
> > <bean:define id="username" type="java.lang.String" name="user"
> > property="userName" toScope="page"/>
> > <bean:message key="msg.hello" arg0="<%=username%>"/>
> > Imho the taglib can't be considered complete, as long as there are <
> > %= %> in
> > the jsp.
> > It would be so simple to provider the message tag with argXName/
> > argXProperty
> > similar to name/property attributes it already has and parallel to
> > arg0-arg5
> > it already has.
> > <bean:message key="msg.hello" arg0Name="user"
> > arg0Property="userName"/>
> >
> > Would it hurt someone? I don't think so.
> > And there are a lot of examples where really simple functionality
> > is missing
> > in struts tags.
> > For example compare tags don't allow second bean/property as value.
> >
> >
> > Other thing. How many struts-tags actually do log? Maybe 20%?
> > Shouldn't it
> > be unified?
> >
> > If there are people, who are ready to implement this, why wouldn't
> > you let
> > them? :-)
> >
> > Regards
> > Leon
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.16/83 - Release Date: 26/08/2005
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to