sourceforge > tacos
 

Additional Goodies

Tacos currently includes one new binding prefix as well as two more form validators.

Binding Prefix

  • template: This binding prefix works like the literal prefix, unless it contains strings such as ${something}. In that case, it evaluates (using OGNL) something and replaces it with the evaluation. For instance, the following two examples are equal:
    <span jwcid="@Insert" value="ognl:'Current page: ' + page.name"/>
    <span jwcid="@Insert" value="template:Current page: ${page.name}"/>

Form Validators

  • real: A validator that ensures the input values are real numbers.
  • filetype: A validator that ensures the input file has the correct extension. Use it with @Upload components, for instance, validators:filetype=jpeg-jpg-png

Prettier URLs

By using AjaxDirectServiceEncoder you can have even prettier urls for your ajax enabled links.

This /ajaxdirect.svc?component=linkToggle&page=ajax%2FEffectsExample&rand=907229478&session=T& sp=Sar_AE&updatedirect=false&updateid=selectedCountries&updateid=ar_AE will become /907229478F0/ajax/EffectsExample/linkToggle,selectedCountries,ar_AE.ajax?sp=Sar_AE

You can enable this encoder by adding a servlet mapping (in your web.xml) for *.ajax to be handled by the Tapestry servlet and by adding the following contribution in your hivemodule.xml:

         	
  <contribution configuration-id="tapestry.url.ServiceEncoders">	
	<encoder id="ajaxSrvEnc" object="instance:net.sf.tacos.ajax.AjaxDirectServiceEncoder"/>
  </contribution>