You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Paul Benedict (JIRA)" <ji...@apache.org> on 2006/12/13 01:33:57 UTC

[jira] Closed: (STR-1410) Enhancement for dynamic link creation

     [ http://issues.apache.org/struts/browse/STR-1410?page=all ]

Paul Benedict closed STR-1410.
------------------------------

    Resolution: Won't Fix

Please see STR-746 which is resolved in Struts 1.3.6. You can now do dynamic parameters, but not in the way this ticket describes.

> Enhancement for dynamic link creation
> -------------------------------------
>
>                 Key: STR-1410
>                 URL: http://issues.apache.org/struts/browse/STR-1410
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.1 RC1
>         Environment: Operating System: All
> Platform: All
>            Reporter: Dieter Wimberger
>         Assigned To: Paul Benedict
>            Priority: Minor
>         Attachments: LinkParamsTag.java, LinkParamsTEI.java, LinkTag_patch.txt, RequestUtils_patch.txt, struts-html_patch.txt
>
>
> Creating dynamic links with request parameters is sometimes inevitable. Struts does have basic 
> possibilities, but there are some enhancements that would make things much easier:
> 1. When creating a link (using html:link) to a DispatchAction, one would like to simply add 
> dispatch=login as request parameter to the link.
> It can be done using a scripting variable, or placing the param identifier and value into a Map (also 
> a scripting variable). However, I think much more convenient would be to use:
> <html:link forward="core.view.folder" paramId="dispatch" paramValue="display">Folder View</
> html:link>
> I have patched the LinkTag as well as the RequestUtil to achieve this. If I figure out how to do so, I 
> will add the patches to this "feature request".
> 2. Sometimes one would like to have much more parameters, which is possible by passing a Map 
> to the html:link tag. However, the question is how to create this Map?
> An utility tag would help to achieve this rather simple, thus I implemented one (which I will attach 
> also to this "feature request").
> It takes parameter identifiers and parameter values or parameter names (specifying beans, 
> respectively their attribute name) and parameterProperties (specifying if one wants to use the bean 
> itself converted to String as value or specifying which property to use). It "exports" a scripting 
> variable named by the id attribute, containing a reference to a created Map (which in turn can be 
> used for the html:link tag).
> Examples:
> <html:linkparams paramIds="action,view" paramValues="redirect,main" id="lp"/>
> <html:link forward="core.session.action" name="lp">
> Redirect to main
> </html:link>
> <html:linkparams paramIds="dispatch" paramNames="core.bean.session" 
> paramProperties="authenticated" id="lp"/>
> <html:link forward="core.session.action" name="lp">xyz</html:link>
> As the tag is using the BeanUtils.getProperty, it should also be possible to specify indexed or 
> nested properties of the bean.
> I have also patched the struts-html.xml to include the new attribute of the link tag, as well as all 
> documentation for the linkparams tag (which I will also try to attach).
> Regards,
> Dieter

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira