You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Mark D. Anderson" <md...@discerning.com> on 2002/09/26 04:37:08 UTC

no error logged for missing method?

If my template refers to some symbol not in the context, such as $notbound
then i see an error in the log.
But if a symbol is in the context, and the template attempts to call some method
that does not exist, I don't see any sign of an error message.
Suppose I do
  context.put("myarr", new java.util.Vector());
and then my template has:
  ## typo! should be "elementAt"
  $myarr.elementT(7)

then i don't see any sign of a problem, except that nothing gets run.

-mda



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


catching syntax and spelling errors

Posted by "Mark D. Anderson" <md...@discerning.com>.
If there is a VTL syntax error such as:
   #esle
then an exception is thrown.

If there is an unbound symbol such as 
   $claendar
then there is an event and (by default) a log warning.

The same is true (I believe) if there is a reference to an unbound member:
  $calendar.FirstDayOfWeak

But if there is a spelling mistake in a method name:
  $calendar.getFirstDayOfWeak()
Then there is no warning, no event, no nothing.

It is hard to tell with a speed-read where that might be done, but looking at
     org/apache/velocity/runtime/parser/node/ASTMethod.java
it appears that a missing method circumstance is just dropped on the floor.

Or maybe I'm missing something.....

-mda


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>