You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Christopher Schultz (JIRA)" <de...@velocity.apache.org> on 2011/07/27 23:33:09 UTC
[jira] [Created] (VELTOOLS-149) LinkTool.addRequestParams methods
are difficult to use from VTL due to their String[] parameter type
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
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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] [Closed] (VELTOOLS-149) LinkTool.addRequestParams methods
are difficult to use from VTL due to their String[] parameter type
Posted by "Nathan Bubna (Closed) (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELTOOLS-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Bubna closed VELTOOLS-149.
---------------------------------
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] [Resolved] (VELTOOLS-149) LinkTool.addRequestParams methods
are difficult to use from VTL due to their String[] parameter type
Posted by "Christopher Schultz (JIRA)" <de...@velocity.apache.org>.
[ 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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org