tapestry-user@jakarta.apache.org
[Top] [All Lists]

Re: Statics in the engine

Subject: Re: Statics in the engine
From: Danny Mandel
Date: Thu, 03 Mar 2005 10:51:11 -0700
To access a static method or var you need to use the full classname syntax.

So if your engine is named com.foo.Engine you need this:

ognl:@com.foo.Engine@DATE_FORMAT

I'm using things like this throughout my app so it is definitely possible.

Danny

Christopher Yates wrote:

Hello,

Page 416 of TIA says a subclassed Engine object is a great place to put
common utility methods.  Well, I have a date format that is a standard
for the whole application and will be used in several places.  So I put
the following in an Engine object:

public static final SimpleDateFormat DATE_FORMAT = new
SimpleDateFormat("M/d/yyyy");

However, when I try to use:

ognl:@engine@DATE_FORMAT

it results in a class not found exception.

ognl:engine@DATE_FORMAT

results in malformed OGNL expression

Is what I'm trying to do possible? Any suggestions?
Even when I try public SimpleDateFormat getDateFormat() { return
DATE_FORMAT; } and ognl:engine.dateFormat I get a No Such Property
Exception.  I checked the inspector and verified the engine class is set
to my engine and not BaseEngine.

Thanks.

-
Chris Yates
Stark County Information Technology
330-451-7432 x4405



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: tapestry-user-help@xxxxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>