You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Shinobu Kawai <sh...@gmail.com> on 2004/10/09 16:20:48 UTC
2nd Case Substitution example in the user guide doesn't work
Hi all,
I was going over the User Guide, and found that the Case Substitution
example for get methods with parameters doesn't work.
The following:
## Let's say that $data.getUser("jon") returns "Doe".
$data.getUser("jon")
## is the same as
$data.User("jon")
produces:
Doe
$data.User("jon")
and not the expected:
Doe
Doe
This didn't work with the latest source in CVS, either. Is this going
to be implemented, or is it just a mistake in the documentation?
Anybody knows?
Best regards,
-- Shinobu Kawai
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: 2nd Case Substitution example in the user guide doesn't work
Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Nathan,
> if the documentation says that $data.User('jon') should work, then it is wrong
> and i'm surprised it's gone so long unnoticed. the short notation for methods
> only works for the standard bean type methods. so:
>
> $foo.setFoo('foo') can be changed to #set( $foo.foo = 'foo' )
>
> $foo.getFoo() can be changed to either $foo.foo or $foo.Foo
>
> and so on. but:
>
> $foo.getFoo('bar') cannot be shortened at all.
>
> and
>
> $foo.thisIsNonStandard() cannot be shortened at all.
>
> if the user guide suggests otherwise, i'd recommend submitting a bugzilla
> report and a patch to clarify/fix things.
Gotcha.
http://issues.apache.org/bugzilla/show_bug.cgi?id=31615
Please wait a sec for the patch...
Best regards,
-- Shinobu Kawai
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: 2nd Case Substitution example in the user guide doesn't work
Posted by Nathan Bubna <na...@esha.com>.
Shinobu Kawai said:
...
> I was going over the User Guide, and found that the Case Substitution
> example for get methods with parameters doesn't work.
>
> The following:
>
> ## Let's say that $data.getUser("jon") returns "Doe".
> $data.getUser("jon")
> ## is the same as
> $data.User("jon")
>
> produces:
>
> Doe
> $data.User("jon")
>
> and not the expected:
>
> Doe
> Doe
>
> This didn't work with the latest source in CVS, either. Is this going
> to be implemented, or is it just a mistake in the documentation?
> Anybody knows?
if the documentation says that $data.User('jon') should work, then it is wrong
and i'm surprised it's gone so long unnoticed. the short notation for methods
only works for the standard bean type methods. so:
$foo.setFoo('foo') can be changed to #set( $foo.foo = 'foo' )
$foo.getFoo() can be changed to either $foo.foo or $foo.Foo
and so on. but:
$foo.getFoo('bar') cannot be shortened at all.
and
$foo.thisIsNonStandard() cannot be shortened at all.
if the user guide suggests otherwise, i'd recommend submitting a bugzilla
report and a patch to clarify/fix things.
Nathan Bubna
nathan@esha.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org