velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Buettner <simon.buett...@googlemail.com>
Subject Re: Passing parameters to a method with variable-length argument list
Date Fri, 31 Aug 2007 23:21:45 GMT
As long as there is no solution i could overload the method like

public String getMessage(String key, String[] values)

but event this is, as far as is know, not possible.

$messageService.getMessage("start.index.welcome" ,[$userSession.user.firstName])

This line has the same effect. The expression is not parsed.


Nathan Bubna schrieb:
> This is a known shortcoming.  https://issues.apache.org/jira/browse/VELOCITY-534
>
> I've some ideas of how we might solve this, but i've been busy with
> other stuff.   If anyone wants to dig into this, i'd be happy to share
> my thoughts.  Patches are welcome, as always! :)
>
> On 8/31/07, Simon Buettner <simon.buettner@googlemail.com> wrote:
>   
>> Hi everyone,
>> i want to call the following method with a variable-length argument list:
>> public String getMessage(String key, String ...values)
>>
>> And this is the velocity template code:
>> $messageService.getMessage("start.index.welcome" ,
>> $userSession.user.firstName)
>>
>> The template is parsed without any errors, but the method is not called.
>> It just puts out:
>> $messageService.getMessage("start.index.welcome" ,
>> $userSession.user.firstName)
>>
>> Best regards
>> Simon
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message