struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject struts-site git commit: Adds missing Alt Syntax page
Date Thu, 21 Sep 2017 10:12:52 GMT
Repository: struts-site
Updated Branches:
  refs/heads/master 46a2618ca -> 27a47e7f8

Adds missing Alt Syntax page


Branch: refs/heads/master
Commit: 27a47e7f8b4ee49327d98587468c003b887561c8
Parents: 46a2618
Author: Lukasz Lenart <>
Authored: Thu Sep 21 12:12:40 2017 +0200
Committer: Lukasz Lenart <>
Committed: Thu Sep 21 12:12:40 2017 +0200

 source/tag-developers/ | 57 ++++++++++++++++++++++++++++++++
 source/tag-developers/      |  2 +-
 2 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/source/tag-developers/ b/source/tag-developers/
new file mode 100644
index 0000000..db41f97
--- /dev/null
+++ b/source/tag-developers/
@@ -0,0 +1,57 @@
+layout: default
+title: Tag Developers Guide (WIP)
+# Alt Syntax
+The _altSyntax_ is an option that can be defined in `struts.xml`. 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
+> You can also turn on the altSyntax on a per-page basis by using the _set_ tag. Simply
set the name _useAltSyntax_  
+> to the value _true_ . From this point on, all tags will use the altSyntax for the rest
of the request.
+The altSyntax changes the behavior of how tags are interpreted. Instead of evaluating each
tag parameter against 
+the value stack and needing single quotes to mark string literals, only marked expressions
are evaluated.
+the following code uses the [Tag Syntax](tag-syntax.html):
+<s:iterator value="cart.items">
+   ...
+   <s:textfield label="'Cart item No.' + #rowstatus.index + ' note'" 
+                 name="'cart.items[' + #rowstatus.index + '].note'" 
+                 value="note" />
+this is somewhat counter intuitive to normal HTML tag behaviour, and you get loads of single
quotes. Now the same example 
+in altSyntax:
+<s:iterator value="cart.items">
+   ...
+   <s:textfield label="Cart item No. %{#rowstatus.index} note" 
+                 name="cart.items[%{#rowstatus.index}].note" 
+                 value="%{note}" />
+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.
+In order to fully understand why this option exists and what the differences are, it is best
to get a bit of history 
+about WebWork.
+> 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](tag-syntax.html) 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.
diff --git a/source/tag-developers/ b/source/tag-developers/
index b9c7efc..f352dbb 100644
--- a/source/tag-developers/
+++ b/source/tag-developers/
@@ -18,7 +18,7 @@ The framework offers a flexible view layer that supports multiple view technolog
   - [OGNL Basics](ognl-basics.html)
   - [OGNL Expression compilatio](ognl-expression-compilation.html)
 - [Tag Syntax](tag-syntax.html)
-- _Alt Syntax_ 
+- [Alt Syntax](alt-syntax.html) 
 - [JSP](jsp.html)
   + [specific tags](jsp-tags.html)
 + [FreeMarker](freemarker.html)

View raw message