[66] | 1 | <html><body><pre> |
---|
| 2 | <!-- |
---|
| 3 | Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 4 | contributor license agreements. See the NOTICE file distributed with |
---|
| 5 | this work for additional information regarding copyright ownership. |
---|
| 6 | The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 7 | (the "License"); you may not use this file except in compliance with |
---|
| 8 | the License. You may obtain a copy of the License at |
---|
| 9 | |
---|
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 11 | |
---|
| 12 | Unless required by applicable law or agreed to in writing, software |
---|
| 13 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 15 | See the License for the specific language governing permissions and |
---|
| 16 | limitations under the License. |
---|
| 17 | --> |
---|
| 18 | <html> |
---|
| 19 | <head> |
---|
| 20 | <title>Tag Plugin Examples: if</title> |
---|
| 21 | </head> |
---|
| 22 | <body> |
---|
| 23 | <h1>Tag Plugin Examples - &lt;c:if></h1> |
---|
| 24 | |
---|
| 25 | <hr> |
---|
| 26 | </br> |
---|
| 27 | <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></a> |
---|
| 28 | <br/> |
---|
| 29 | <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000FF"></a> |
---|
| 30 | <br/> <br/> |
---|
| 31 | <hr> |
---|
| 32 | |
---|
| 33 | <font color="#000000"/> |
---|
| 34 | </br> |
---|
| 35 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
---|
| 36 | |
---|
| 37 | <h3>Set the test result to a variable</h3> |
---|
| 38 | <c:if test="${1==1}" var="theTruth" scope="session"/> |
---|
| 39 | The result of testing for (1==1) is: ${theTruth} |
---|
| 40 | |
---|
| 41 | <h3>Conditionally execute the body</h3> |
---|
| 42 | <c:if test="${2>0}"> |
---|
| 43 | It's true that (2>0)! |
---|
| 44 | </c:if> |
---|
| 45 | </body> |
---|
| 46 | </html> |
---|
| 47 | </pre></body></html> |
---|