[
https://issues.apache.org/jira/browse/VELTOOLS-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christopher Schultz resolved VELTOOLS-149.
------------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.x
Fixed in r1151648.
- Change methods to accept Object[] instead of String[].
> LinkTool.addRequestParams methods are difficult to use from VTL due to their
> String[] parameter type
> ----------------------------------------------------------------------------------------------------
>
> Key: VELTOOLS-149
> URL: https://issues.apache.org/jira/browse/VELTOOLS-149
> Project: Velocity Tools
> Issue Type: Bug
> Affects Versions: 2.0
> Environment: Velocity 1.7, Velocity-Tools 2.0
> Reporter: Christopher Schultz
> Priority: Minor
> Fix For: 2.0.x
>
>
> If I call addRequestParams() with no argument, things work as expect. On the
> other hand, this does not work:
> #set($ignoreList = ['foo'])
> $link.relative('/bar').addRequestParamsExcept($ignoreList)
> I get an invalid reference log message and the above "$link..." text is
> rendered as written instead of evaluating successfully.
> The problem is that the ignoreList is a List and it needs to be String[].
> Velocity will auto-convert Lists into Object[] if appropriate, but the
> resulting object type is Object[] and not String[].
> There does not appear to be a way to create a String[] from a Velocity
> template, so using addRequestParams and the other, similar methods will be
> very difficult to use with an argument.
> LinkTool.addRequestParams and friends should be modified to accept Object[]
> arguments.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]