Dear Wiki user,

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

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

The comment on the change is:
add entry about public, public, public!

------------------------------------------------------------------------------
  #pragma section-numbers off
  The archives are littered with snippets of wisdom that are not captured in 
the User or Developer guides. Find something that isn't in the manual, and 
folks ask a lot on the list? Please, add it here. Eventually, the info may move 
into the offical guides.  If you have a specific question that is not answered 
here or in the [http://marc.theaimsgroup.com/?l=velocity-user&r=1&w=2 mailing 
list archives], then ask please the user list.
  === Velocity ===
+  * Q: Why isn't foo() method on Foobar object working?  The object is in the 
template ($foobar works!) but the method is not resolved ($foobar.foo() doesn't 
work!)?  Why can't Velocity find my method?
+  * 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.
  [[BR]]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to