You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Apache Wiki <wi...@apache.org> on 2009/07/13 21:04:53 UTC

[Velocity Wiki] Trivial Update of "VelocityFAQ" by davetron5000

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Velocity Wiki" for change notification.

The following page has been changed by davetron5000:
http://wiki.apache.org/velocity/VelocityFAQ

The comment on the change is:
not parens

------------------------------------------------------------------------------
   * A: Make sure that both the Foobar class and the foo() method are declared as "public".  Velocity will only allow public methods on public classes to be called for security reasons.  Many people will declare the method public, but leave the class as package private.  Declare both the class and the method as public and Velocity should cooperate nicely.
  [[BR]]
   * Q: How can conditionals be nested?  For example, in the equivalent of "if($a){ if($b){ b1; } else{ b2; } if($c){ c1; } else { c2; } }", where do the '#end's go?
-  * A: Exactly where you put the closing parentheses in java.  So your example would be "#if( $a )#if( $b ) b1 #else b2 #end #if( $c ) c1 #else c2 #end#end".  Pretty easy.
+  * A: Exactly where you put the closing braces in java.  So your example would be "#if( $a )#if( $b ) b1 #else b2 #end #if( $c ) c1 #else c2 #end#end".  Pretty easy.
  [[BR]]
   * Q: Adding ## at the end of a template causes a parsing exception, what do I do?
   * A: For now, a workaround is: add a newline to the end of the file.

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