Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The altSyntax is an option that can be defined in webwork struts.properties. By default it is set to true and it is strongly recommend you do not change that unless you are upgrading from WebWork 2.1.7 or previous versions.

...

the following code uses the Tag Syntax:

Code Block
<ww<s:iterator value="cart.items">
   ...
   <ww<s:textfield label="'Cart item No.' + #rowstatus.index + ' note'" 
                 name="'cart.items[' + #rowstatus.index + '].note'" 
                 value="note" />
</wws:iterator>

this is somewhat counter intuitive to normal HTML tag behaviour, and you get loads of single quotes. Now the same example in altSyntax:

Code Block
<ww<s:iterator value="cart.items">
   ...
   <ww<s:textfield label="Cart item No. %{#rowstatus.index} note" 
                 name="cart.items[%{#rowstatus.index}].note" 
                 value="%{note}" />
</wws:iterator>

Only expressions enclosed with %{} are evaluated. The code is shorter and clearer, very similar to JSTL EL usage. Quoting problems, eg. with javascript function calls, are avoided.

...

Note

If you are not upgrading from WebWork 2.1.7 or previous versions and you don't care about the history of WebWork's evolution, you can skip this section. See the Tag Syntax section for more information on the standard tag syntax support

History

In WebWork 2.1.4, the altSyntax option was introduced. The book, WebWork in Action, while based around WebWork 2.1.7, was entirely written with the assumption that the altSyntax was enabled. As of WebWork 2.2, the altSyntax is turned on by default and eventually the old syntax will no longer be supported and will be removed from the code.