struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Wilson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STR-1410) Enhancement for dynamic link creation
Date Tue, 12 Dec 2006 21:56:57 GMT
    [ http://issues.apache.org/struts/browse/STR-1410?page=comments#action_39069 ] 
            
Sam Wilson commented on STR-1410:
---------------------------------

Does this mean that struts no longer recommends the use of the html:link tag because jstl
provides something similar?

I mean.. the guy even provided a patch..

> 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: Ted Husted
>            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

        

Mime
View raw message