The bean:define tag can create new attributes and scripting variables of
type String or create a copy of an existing bean or property on an
existing bean. The standard jsp:useBean covers creating a new instance
of any class with a default constructor, so why duplicate that
functionality in a Struts specific tag?


-Adam

-----Original Message-----
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 15, 2006 12:02 PM
To: Struts Users Mailing List
Subject: Re: [HELP] bean:define and Map

Thanks, this works.
Can you explain to me why I couldn't do the same thing with bean:define?

On 6/15/06, Samere, Adam J <[EMAIL PROTECTED]> wrote:
> There are probably numerous ways to accomplish this, what I like to do

> is define/instantiate the Map using the <jsp:useBean/> tag, then set 
> the key/value pairs using the <c:set/> tag from JSTL.
>
> <jsp:useBean id="paramsMap" class="java.util.HashMap"/> You MUST to 
> use a concrete implementation of java.util.Map, not the interface.
>
> <c:set target="${paramsMap}" property="key1" value="myvalue"/>
>
> <c:set target="${paramsMap}" property="key2" value="another value"/>
>
> <html:link action="/someAction" name="paramsMap">Some 
> Where</html:link>
>
> -Adam
>
> -----Original Message-----
> From: Garner Shawn [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 15, 2006 11:24 AM
> To: user@struts.apache.org
> Subject: [HELP] bean:define and Map
>
> <bean:define id="paramsMap" type="java.util.Map"/>
>
>
> I get a can not set null value form paramsMap.
> How do I specify the key, value pairs?
>
> This is to pass into html:link name="" for request parameters when 
> they click on the link.
>
> Thanks.
> Shawn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -----------------------------------------
> The information contained in this message may be privileged, 
> confidential, and protected from disclosure. If the reader of this 
> message is not the intended recipient, or any employee or agent 
> responsible for delivering this message to the intended recipient, you

> are hereby notified that any dissemination, distribution, or copying 
> of this communication is strictly prohibited. If you have received 
> this communication in error, please notify us immediately by replying 
> to the message and deleting it from your computer.
>
> Thank you. Paychex, Inc.
>
>
> ---------------------------------------------------------------------
> 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to