On Tue, Jan 13, 2009 at 3:37 PM, Jason Berk <[email protected]> wrote: > Velocity rocks, but I do have a few questions: > > 1. when/where is the javadoc for the 1.6 engine?
http://velocity.apache.org/engine/releases/velocity-1.6/apidocs/index.html > 2. is it possible to do a regex in a template? If you are running on a JDK that supports it (1.5+), yes. > > Something like this: > > #set( $regex = "foo" ) I would do #set( $regex = 'foo' ) just to ensure Velocity doesn't interpolate your regex. > #foreach( $item in $itemList ) > #if( $item.getItemId().startsWith($regex) ) Assuming that getItemId() returns a String, you will need to use the matches(String regex) method. startsWith() doesn't expect a regex. > ...do something... > #end > #end > > Make sense? > > Thanks, > > Jason > > > The PEN is now mightier than the PIN. Simply use your PEN > instead of your PIN and sign for your PEFCU Visa Check Card > purchases. Earn bonus points redeemable for gift and travel > awards. Combine PEFCU Visa check card and credit card points > for even more rewards. > > > ***This is a transmission from Purdue Employees Federal Credit > Union (PEFCU) and is intended solely for its authorized > recipient(s), and may contain information that is confidential > and or legally privileged. If you are not an addressee, or the > employee or agent responsible for delivering it to an addressee, > you are hereby notified that any use, dissemination, > distribution, publication or copying of the information > contained > in this email is strictly prohibited. If you have received this > transmission in error, please notify us by telephoning (765) > 497-3328 or returning the email. You are then instructed to > delete the information from your computer. Thank you for your > cooperation.*** > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
