"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




Reply via email to