blob: 9039db93a149a373a76813dac5d1f4d8ace4c668 [file] [log] [blame]
<!--
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.
-->
<j:jelly xmlns:j="jelly:core">
<j:switch on="${switch.on.a}">
<j:case value="one" fallThru="true">
<j:set var="a.one" value="true"/>
</j:case>
<j:case value="two">
<j:set var="a.two" value="true"/>
</j:case>
<j:case value="three">
<j:set var="a.three" value="true"/>
</j:case>
<j:case value="${null}">
<j:set var="a.null" value="true"/>
</j:case>
<j:default>
<j:set var="a.default" value="true"/>
</j:default>
</j:switch>
<j:if test="${switch.without.on}">
<j:switch>
<j:case value="one" fallThru="true"/>
<j:case value="two"/>
<j:case value="three"/>
<j:case value="${null}"/>
<j:default/>
</j:switch>
</j:if>
<j:if test="${case.without.switch}">
<j:case value="this tag should cause an exception"/>
</j:if>
<j:if test="${default.without.switch}">
<j:default/>
</j:if>
<j:if test="${case.without.value}">
<j:switch on="foo">
<j:case>
<!-- this should cause an exception (or even better, fail on validation) -->
</j:case>
</j:switch>
</j:if>
<j:if test="${multiple.defaults}">
<j:switch on="foo">
<j:case value="bar">
</j:case>
<j:default>
</j:default>
<j:default>
<!-- this one should cause an exception (or even better, fail on validation) -->
</j:default>
</j:switch>
</j:if>
<j:if test="${case.after.default}">
<j:switch on="foo">
<j:default>
</j:default>
<j:case value="bar">
<!-- this one should cause an exception (or even better, fail on validation) -->
</j:case>
</j:switch>
</j:if>
</j:jelly>