You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Andrew Wilson <an...@db.com> on 2005/01/18 04:11:54 UTC

Usage question.

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})}

but that doesn't work either.

Any suggestions?

Kindest regards,
Andrew.


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


Re: Usage question.

Posted by Mike Kienenberger <mk...@alaska.net>.
Andrew Wilson <an...@db.com> 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.

-Mike

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