From 974631ddd21b4564e89a6562590fa83c3f2d51aa Mon Sep 17 00:00:00 2001 From: Toby Jee Date: Wed, 30 Aug 2006 07:45:32 +0000 Subject: [PATCH] WW-1422 - alter if tag example (jsp / freemarker template) in showcase to test for this issue. - the example should have tested most git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@438411 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/webapp/tags/non-ui/ifTag/testIf.ftl | 609 ++++++++++++++++- .../main/webapp/tags/non-ui/ifTag/testIf.jsp | 617 ++++++++++++++++-- 2 files changed, 1152 insertions(+), 74 deletions(-) diff --git a/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.ftl b/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.ftl index 2f5e8a7df..a40b756c7 100644 --- a/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.ftl +++ b/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.ftl @@ -2,67 +2,606 @@ TEST IF - - + +

+This is a simple freemarker template to test the If Tag (using freemarker directive). +There's quite a few combination being tested. The characters in bold and non-bold should be the same. +

+ + +1 - Foo - <@s.if test="true"> - 1]THIS SHOULD APPEAR
+ Foo <@s.else> - THIS SHOULD NOT APPEAR
+ Bar - - - +
+2 - Bar - <@s.if test="false"> - THIS SHOULD NOT APPEAR
+ Foo + +<@s.else> + Bar + +
+3 - FooFooFoo - +<@s.if test="true"> + Foo + <@s.if test="true"> + FooFoo + + <@s.else> + BarBar + + +<@s.else> + Bar + +
+4 - FooBarBar - +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + <@s.else> + BarBar + + +
+5 - BarFooFoo - +<@s.if test="false"> + Foo + +<@s.else> + Bar + <@s.if test="true"> + FooFoo + + <@s.else> + BarBar + + +
+6 - BarBarBar - +<@s.if test="false"> + Foo + +<@s.else> + Bar + <@s.if test="false"> + FooFoo + + <@s.else> + BarBar + + +
+7 - Foo - +<@s.if test="true"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + +
+8 - Moo - +<@s.if test="false"> + Foo <@s.elseif test="true"> - 2]THIS SHOULD APPEAR
+ Moo - - +<@s.else> + Bar + +
+9 - Bar - <@s.if test="false"> - THIS SHOULD NOT APPEAR
+ Foo <@s.elseif test="false"> - THIS SHOULD NOT APPEAR
+ Moo +<@s.else> + Bar + +
+10 - FooFooFoo - +<@s.if test="true"> + Foo + <@s.if test="true"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + <@s.else> + BarBar + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + +
+11 - FooMooMoo - +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + <@s.elseif test="true"> + MooMoo + + <@s.else> + BarBar + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + +
+12 - FooBarBar - +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + <@s.else> + BarBar + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + +
+13 - MooFooFoo - +<@s.if test="false"> + Foo + <@s.elseif test="true"> - 3]THIS SHOULD APPEAR
+ Moo + <@s.if test="true"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + <@s.else> + BarBar + +<@s.else> + Bar + +
+14 - MooMooMoo - +<@s.if test="false"> + Foo + <@s.elseif test="true"> - THIS SHOULD NOT APPEAR
+ Moo + <@s.if test="false"> + FooFoo + + <@s.elseif test="true"> + MooMoo + + <@s.else> + BarBar + <@s.else> - THIS SHOULD NOT APPEAR
+ Bar - - +
+15 - MooBarBar - <@s.if test="false"> - THIS SHOULD NOT APPEAR
+ Foo + +<@s.elseif test="true"> + Moo + <@s.if test="false"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + <@s.else> + BarBar + + +<@s.else> + Bar + +
+16 - BarFooFoo - +<@s.if test="false"> + Foo <@s.elseif test="false"> - THIS SHOULD NOT APPEAR
+ Moo <@s.else> - 4]THIS SHOULD APPEAR
- - - -<@s.if test="false"> - THIS SHOULD NOT APPEAR
+ Bar + <@s.if test="true"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + <@s.else> + BarBar + + +
+17 - BarMooMoo - +<@s.if test="false"> + Foo <@s.elseif test="false"> - THIS SHOULD NOT APPEAR
- -<@s.elseif test="false"> - THIS SHOULD NOT APPEAR
- -<@s.elseif test="false"> - THIS SHOULD NOT APPEAR
+ Moo <@s.else> - 5]THIS SHOULD APPEAR
+ Bar + <@s.if test="false"> + FooFoo + + <@s.elseif test="true"> + MooMoo + + <@s.else> + BarBar + + +
+18 - BarBarBar - +<@s.if test="false"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + <@s.if test="false"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + <@s.else> + BarBar + - + +
+19 - Foo - +<@s.if test="true"> + Foo + + +
+20 - ** should not display anything ** - +<@s.if test="false"> + Foo + + +
+21 FooFooFoo - +<@s.if test="true"> + Foo + <@s.if test="true"> + FooFoo + + +<@s.else> + Bar + + +
+22 - Foo - +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + +<@s.else> + Bar + + +
+23 - BarFooFoo - +<@s.if test="false"> + Foo + +<@s.else> + Bar + <@s.if test="true"> + FooFoo + + + +
+24 - Bar - +<@s.if test="false"> + Foo + +<@s.else> + Bar + <@s.if test="false"> + FooFoo + + + +
+25 - FooFooFoo +<@s.if test="true"> + Foo + <@s.if test="true"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + + +
+26 - FooMooMoo +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + <@s.elseif test="true"> + MooMoo + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + + +27 - Foo - +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + + +28 - MooFooFoo +<@s.if test="false"> + Foo + +<@s.elseif test="true"> + Moo + <@s.if test="true"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + +<@s.else> + Bar + + + +29 - MooMooMoo +<@s.if test="false"> + Foo + +<@s.elseif test="true"> + Moo + <@s.if test="false"> + FooFoo + + <@s.elseif test="true"> + MooMoo + + +<@s.else> + Bar + + + +30 - Moo - +<@s.if test="false"> + Foo + +<@s.elseif test="true"> + Moo + <@s.if test="false"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + +<@s.else> + Bar + + + +31 - BarFooFoo - +<@s.if test="false"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + <@s.if test="true"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + + +32 - BarMooMoo - +<@s.if test="false"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + <@s.if test="false"> + FooFoo + + <@s.elseif test="true"> + MooMoo + + + +33 - Bar - +<@s.if test="false"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + <@s.if test="false"> + FooFoo + + <@s.elseif test="false"> + MooMoo + + + +
+34 - FooFooFoo - +<@s.if test="true"> + Foo + <@s.if test="true"> + FooFoo + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + + +
+35 - Foo - +<@s.if test="true"> + Foo + <@s.if test="false"> + FooFoo + + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + + +
+36 - MooFooFoo - +<@s.if test="false"> + Foo + +<@s.elseif test="true"> + Moo + <@s.if test="true"> + FooFoo + + +<@s.else> + Bar + + +
+37 - Moo - +<@s.if test="false"> + Foo + +<@s.elseif test="true"> + Moo + <@s.if test="false"> + FooFoo + + +<@s.else> + Bar + + +
+38 - BarFooFoo - +<@s.if test="false"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + <@s.if test="true"> + FooFoo + + + +
+39 - Bar - +<@s.if test="false"> + Foo + +<@s.elseif test="false"> + Moo + +<@s.else> + Bar + <@s.if test="false"> + FooFoo + + + + + + + + diff --git a/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.jsp b/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.jsp index 7c629d57b..62ec5888b 100644 --- a/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.jsp +++ b/apps/showcase/src/main/webapp/tags/non-ui/ifTag/testIf.jsp @@ -7,69 +7,608 @@ -Insert title here +Test If Tag - +

+This is a simple jsp to test the If Tag. There's quite a few combination being tested. +The characters in bold an non-bold should be the same. +

+ + +1 - Foo - - 1]THIS SHOULD APPEAR
+ Foo
- THIS SHOULD NOT APPEAR
+ Bar +
+
+2 - Bar - + + Foo + + + Bar + +
+3 - FooFooFoo - + + Foo + + FooFoo + + + BarBar + + + + Bar + +
+4 - FooBarBar - + + Foo + + FooFoo + + + BarBar + + +
+5 - BarFooFoo - + + Foo + + + Bar + + FooFoo + + + BarBar + + +
+6 - BarBarBar - + + Foo + + + Bar + + FooFoo + + + BarBar + + +
+7 - Foo - + + Foo + + + Moo + + + Bar + +
+8 - Moo - + + Foo + + + Moo + + + Bar + +
+9 - Bar - + + Foo + + + Moo + + + Bar + +
+10 - FooFooFoo - + + Foo + + FooFoo + + + MooMoo + + + BarBar + + + + Moo + + + Bar + +
+11 - FooMooMoo - + + Foo + + FooFoo + + + MooMoo + + + BarBar + + + + Moo + + + Bar + +
+12 - FooBarBar - + + Foo + + FooFoo + + + MooMoo + + + BarBar + + + + Moo + + + Bar + +
+13 - MooFooFoo - + + Foo + + + Moo + + FooFoo + + + MooMoo + + + BarBar + + + + Bar + +
+14 - MooMooMoo - + + Foo + + + Moo + + FooFoo + + + MooMoo + + + BarBar + + + + Bar + +
+15 - MooBarBar - + + Foo + + + Moo + + FooFoo + + + MooMoo + + + BarBar + + + + Bar + +
+16 - BarFooFoo - + + Foo + + + Moo + + + Bar + + FooFoo + + + MooMoo + + + BarBar + + +
+17 - BarMooMoo - + + Foo + + + Moo + + + Bar + + FooFoo + + + MooMoo + + + BarBar + + +
+18 - BarBarBar - + + Foo + + + Moo + + + Bar + + FooFoo + + + MooMoo + + + BarBar + + + +
+19 - Foo - + + Foo + + +
+20 - ** should not display anything ** - + + Foo + + +
+21 FooFooFoo - + + Foo + + FooFoo + + + + Bar + + +
+22 - Foo - + + Foo + + FooFoo + + + + Bar + + +
+23 - BarFooFoo - + + Foo + + + Bar + + FooFoo + + + +
+24 - Bar - + + Foo + + + Bar + + FooFoo + + + +
+25 - FooFooFoo + + Foo + + FooFoo + + + MooMoo + + + + Moo + + + Bar + + +
+26 - FooMooMoo + + Foo + + FooFoo + + + MooMoo + + + + Moo + + + Bar + + +
+27 - Foo - + + Foo + + FooFoo + + + MooMoo + + + + Moo + + + Bar + + +
+28 - MooFooFoo + + Foo + + + Moo + + FooFoo + + + MooMoo + + + + Bar + + +
+29 - MooMooMoo + + Foo + + + Moo + + FooFoo + + + MooMoo + + + + Bar + + +
+30 - Moo - + + Foo + + + Moo + + FooFoo + + + MooMoo + + + + Bar + + +
+31 - BarFooFoo - + + Foo + + + Moo + + + Bar + + FooFoo + + + MooMoo + + + +
+32 - BarMooMoo - + + Foo + + + Moo + + + Bar + + FooFoo + + + MooMoo + + + +
+33 - Bar - + + Foo + + + Moo + + + Bar + + FooFoo + + + MooMoo + - - - THIS SHOULD NOT APPEAR
-
- - 2]THIS SHOULD APPEAR
-
- - - - THIS SHOULD NOT APPEAR
+
+34 - FooFooFoo - + + Foo + + FooFoo + - THIS SHOULD NOT APPEAR
-
- - 3]THIS SHOULD APPEAR
-
- - THIS SHOULD NOT APPEAR
+ Moo
- THIS SHOULD NOT APPEAR
+ Bar
- - - THIS SHOULD NOT APPEAR
+
+35 - Foo - + + Foo + + FooFoo + - THIS SHOULD NOT APPEAR
+ Moo
- 4]THIS SHOULD APPEAR
+ Bar
- +
+36 - MooFooFoo - - THIS SHOULD NOT APPEAR
+ Foo
- - THIS SHOULD NOT APPEAR
-
- - THIS SHOULD NOT APPEAR
-
- - THIS SHOULD NOT APPEAR
+ + Moo + + FooFoo + - 5]THIS SHOULD APPEAR
+ Bar +
+ +
+37 - Moo - + + Foo + + + Moo + + FooFoo + + + + Bar + + +
+38 - BarFooFoo - + + Foo + + + Moo + + + Bar + + FooFoo + + + +
+39 - Bar - + + Foo + + + Moo + + + Bar + + FooFoo +