You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jack Frosch <jf...@froschenterprises.com> on 2002/02/22 21:05:48 UTC

Request Parms Use Name NOT ParamName

FYI:

The HTML TagLib Developer Guide.pdf says,

"To pass multiple dynamic parameters, you can store them in a
java.util.Map, and use the name of the
map for the ***paramName***. The map must then contain one or more
paramIds and their corresponding
values. As the Map is processed, the keys are assumed to be the names of
query parameters to be appended.
The value associated with each key must be either a String or a String
array representing the parameter
value(s). If a String array is specified, more than one value for the
same query parameter name will be
created." [*** notes my emphasis]

After unsuccessfully struggling to get my parameter map to work, I broke
down and reviewed the LinkTag source code.  To construct the parms, it
relies on the computeParameters method in RequestUtils.  That method has
the following code snippet:

  // Locate the Map containing our multi-value parameters map
  Map map = null;
  try {
    if (name != null)
      map = (Map) lookup(pageContext, name, property, scope);
  } catch ...

So it seems, the paramName attribute is not the one to use, but the name
parameter is.  I assigned the Map name to the name attribute and it
worked!

Maybe the docs are wrong.  Maybe the RequestUtils computeParameters
method is wrong.  Maybe I just got it all wrong.  I'm not sure which,
but finally my code works.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>