In Tapestry 4, we shifted a lot of logic into OGNL because that was the only logic that could be reloaded (with the template) at runtime, during development. This was good in some ways, OGNL is still more versatile than Tapestry 5's property expressions, but came at a huge cost in terms of reflection overhead and a few highly contested code paths that tended to serialize the application.
In Tapestry 5, you tend to reference a property from your template, as Thiago pointed out. Both the template and the Java code reload instantly, and the separation makes each part a bit cleaner. On Tue, Oct 25, 2011 at 7:46 AM, Thiago H. de Paula Figueiredo <thiag...@gmail.com> wrote: > On Tue, 25 Oct 2011 12:14:47 -0200, Brian Long <bl...@annadaletech.com> > wrote: > >> Hi all, > > Hi! > >> was hoping someone could point me in the direction on a good tutorial >> on the new property expressions in tapestry 5.2.6? > > http://tapestry.apache.org/property-expressions.html > >> I was using OGNL >> previously and would like to update these expression to work with >> ANTLR instead. > > What do you mean by "to update these expression to work with ANTLR"? I'm not > following you. And don't forget that you can add your own binding > implementations in Tapestry. prop (property expressions) is just one of > them. > >> <t:textfield t:id="surname" t:value="surname" class="${ognl:surname == >> null ? 'touch-and-type' : ''}" /> >> > > Easy: > > <t:textfield t:id="surname" t:value="surname" class="${surnameCssClass}"/> > > public String getSurnameCssClass() { > return surname == > null ? 'touch-and-type' : ''; > } > > Logic should be on Java classes, not templates. That's the Tapestry 5 > philosophy (MVC's too). > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org