[ 
https://issues.apache.org/jira/browse/VELTOOLS-88?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nathan Bubna resolved VELTOOLS-88.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0
                   1.x
                   1.4

Ok, i've committed the patch and the tests with a few modifications (mostly 
stylistic, but also a few simplifications) to the trunk (1.x branch) and ported 
them over to the 2.x branch with a few more tweaks, including a refactor of 
addAllParameters() that i'll port back to 1.x momentarily...

Regarding the overzealous backup code in LinkTool.duplicate()...  yeah, it's 
probably unnecessary.  feel free to post a patch to excise it, if you feel so 
inclined.

> LinkTool could easily be modified to support current-request parameter 
> duplication
> ----------------------------------------------------------------------------------
>
>                 Key: VELTOOLS-88
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-88
>             Project: Velocity Tools
>          Issue Type: New Feature
>            Reporter: Christopher Schultz
>            Priority: Trivial
>             Fix For: 1.4, 1.x, 2.0
>
>         Attachments: LinkToolTests.java, VELTOOLS-88.diff, VELTOOLS-88a.diff
>
>
> When implementing a pager a long time ago, I created a subclass of the 
> StrutsLinkTool that added two methods: ignore(String paramName) and 
> addAllParameters(). Together, they could be used to copy all the parameters 
> from the current request into the link currently being built, and you could 
> ignore a parameter from the current request using the ignore method.
> I hadn't seen any demand for such a feature out in the wild, so I kept it to 
> myself.
> Now that I'm looking into Struts 2, I can see that their link builder tool 
> has the same capability. Since that team decided to add this feature, I'm 
> offering to add it to the LinkTool, which will provide the same capability to 
> all subclasses such as StrutsLinkTool and SecureLinkTool.
> The change would not affect any existing code out in the wild: this would 
> merely be a new method which supports the new feature. Its use is entirely 
> optional and should not disturb any other code.
> The behavior of the Struts 2 link builder is to replace any current-request 
> parameter explicitly set in the link builder, while my implementation 
> requires that you explicitly ignore those parameters. My enhancement can 
> follow either strategy (and I'd appreciate feedback on this item).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to