velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Wilson" <>
Subject RE: Usage question.
Date Tue, 18 Jan 2005 04:29:10 GMT
No, its not a literal, basically its an enum implemented with Strings.

You're right that I can get around the problem by using the underlying
string, but I wanted more type safety by specifying the compile reference.

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 


But I wanted the compile time safety of :


I know Im stretching Velocity (which I really like having used WebMacro
ages ago) but it would be nice...


-----Original Message-----
From: [] 
Sent: Tuesday, 18 January 2005 3:10 PM
Subject: Re: Usage question.

Andrew Wilson <> wrote:
> Id like to include the following code in my Velocity Template:
> ${request.getProperty(Request.ID)}
> Unfortunately, this doesn't compile.
> Is there a clever way I can do this with a Macro?
> Since request is an instance of Request I would also be happy with
> ${request.getProperty(${request.ID})}

If "Request.ID" is a literal, put it in quotes.
If it's not a literal, you'll have to provide us with more information.


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


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

View raw message