velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai Yoshida <>
Subject Re: Usage question.
Date Tue, 18 Jan 2005 13:54:14 GMT
Hi Andrew,

> ie the definition is (with package etc)
> public static final String = "ID";
> Then I use this to put things in a HashMap.
> I can get this to work using
> ${request.getProperty("ID")};
> But I wanted the compile time safety of :
> ${request.getProperty(Request.ID")};

Don't know much about WebMacro, but I can think of a couple ways.

1. Put Request.ID in the context.
Let's say, $id.  Then you can do:

2. Put Request in the context, and make a getter method.
Let's say $req and #getId().  Then you can do:

3. Haven't tried it with static fields, but the PublicFieldUberspect.
## You'll still need an instance of Request in the Context.

4. Haven't tried it, but I found a tool here:

Hope that helps.  :)

Best regards,
-- Shinobu

Shinobu "Kawai" Yoshida <>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message