Hi again,

The values in your hash map have been hardcoded in, which works fine.  But 
what do I if I do not know what the user's selection will be in advance.  
Take for instance, if I have a set of checkboxes on my page, I would like to 
be able to initialize the map with the values that the user has selected.  
Or am I just missing the point here?

Please explain further and thank you very much for your patience.

Thanks
Lisa


>From: "Gregor Rayman" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>CC: "lisa ward" <[EMAIL PROTECTED]>
>Subject: Re: dynamic forwards
>Date: Wed, 26 Sep 2001 20:55:34 +0200
>
>"lisa ward" <[EMAIL PROTECTED]> wrote:
>
> > Another quick question.  How would I be able to initialize the hashMap.  
>the
> > problem Im facing is that when I use a forward the submit is not called 
>so
> > the values are not initialized in my bean.
>
>Here an quick and dirty example. (Dirty beacuse it uses scriplte. Custom 
>tag
>would be somehow more apprpriate.)
>
><%
>   HashMap linkParams = new HashMap(); // create the map
>   linkParams.put("areaId", "a"); // set the values
>   linkParams.put("aspectId", "b");
>   pageContext.setAttribute("linkParams", linkParams); // make the map an
>attribute of page
>%>
>
><html:link page="/deleteaspect.do" name="linkParams">
>   <bean:message key="button.delete"/>
></html:link>
>
>The generated URL will be: .../deleteaspect.do?areaId=a&aspectId=b
>
>The map does not have to be the attribute itself. It can be a property of 
>an
>attribute. Then the <html:link> tag would look like this:
>
><html:link page="/deleteaspect.do" name="linkAttribute"
>property="propertyName">
>
>--
>gR
>
>
>
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Reply via email to