struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Idea for a new tag
Date Tue, 27 Jun 2000 02:05:40 GMT
Richard Backhouse wrote:

> As I have been using struts for the development of an app I have had a
> requirement for a more flexible link tag. What I mean by this is dynamically
> adding to the supplied url parameter from say a bean property or possibly a
> hashtable of name/value pairs. What I had in mind was :
>
> <struts:paramLink
> url="action.do"
> target="target"
> name="beanName"
> property="hashtablePropertyName">
>
> The name/value pairs would be added as parameters to the url :
>
> url="action.do?name1=value1&name2=value2 etc.
>
> What do you think ?
>

This idea is quite interesting.  I've added this functionality to the basic
<struts:link> bean.  The collection that contains the name-value pairs must be a
java.util.Map (Java2 required), and the values can either be single strings or a
String array (for multiple values to the same parameter).  For JDK 1.1 use, the
<struts:link1> tag has the same functionality, but is based on a Dictionary
instead (which includes Hashtables).

Consistent with other Struts beans, you can specify the Map or Dictionary in two
different ways:

* Only the "name" attribute -- the tag looks up a bean under this
  name in any scope.  This bean must implement Map or
  Dictionary, depending on which tag you used.

* Both "name" and "property" attributes.  The property getter
  method for the specified property is called on the bean
  specified by the name attribute.  As with the name-only
  approach, the getter must return a Map or Dictionary,
  depending on whether you use <struts:link> or
  <struts:link1>.

>
> Richard Backhouse
> Oak Grove Software

The new functionality will be available in tonight's nightly build.

Craig



Mime
View raw message