Hello Eric,

Friday, June 08, 2001, 4:50:25 PM, you wrote:

EF> In a recent project, we had to face quite often the fact that we wanted to
EF> use a <html:link> tag with multiple request parameters. I know that this tag
EF> allows the use of a Map with all the parameters. However, we found its usage
EF> quite difficult specially when the <html:link<> tag was embedded in a
EF> <logic:iterate> tag and when the request parameters were dynamic.

Good idea.

EF> So I write an extension to the <html:link> tag so that we can add parameter
EF> tags in its body. Actually, I have rewrite the <html:link> tag because the
EF> new tag had to extend BodyTagSupport and not TagSupport.

EF> I have hereby attached both tags (the link tag and the linkparam tag) if
EF> somebody is interested. I let you decide to put them in the standard Struts
EF> core functionality (I would be very happy :-))) ).

EF> The link tag works exactly the same as the standard struts tag. The
EF> linkparam tag does not include the Struts philosophy (I mean being able to
EF> refer directly to a bean and its properties for the value) but the
EF> attributes could be computed at runtime.

EF> Here is an example (too simple to be representative) of use:

EF> <hm:link href="request.do">
EF>     <hm:paramlink name="action" value="read" />
EF>     <hm:paramlink name="docref" value="55363" />
EF>     This is the link for the request.
EF> </hm:link>

Tag in your sample uses static values only - may be more flexible
approach is to use such construction as -

 <hm:link href="request.do">
     <hm:paramlink name="action" value="read" />
     <hm:paramlink name="docref" sourceName="doc" sourceProperty="ref" />
     This is the link for the request.
 </hm:link>

 sourceName - name of the bean and sourceProperty is property name to
 retrieve value of docref parameter.

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to