# Struts2 Showcase - Non Ui Tag - Test If Tag (Freemarker)

<#-- /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ -->

# Non Ui Tag - Test If Tag (Freemarker)

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"> Foo <@s.else> Bar
2 - Bar - <@s.if test="false"> 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"> Moo <@s.else> Bar
9 - Bar - <@s.if test="false"> Foo <@s.elseif test="false"> 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"> 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"> Moo <@s.if test="false"> FooFoo <@s.elseif test="true"> MooMoo <@s.else> BarBar <@s.else> Bar
15 - MooBarBar - <@s.if test="false"> 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"> Moo <@s.else> 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"> Moo <@s.else> 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