InterviewSolution
| 1. |
Explain Jstl Choose, When, Otherwise Tag With An Example? |
|
Answer» JSTL choose, when, otherwise tag: These are conditional tags used to implement conditional operations. If the test condition of the when tag evaluates to true, then the content within when tag is evaluated, otherwise the content within the otherwise tag is evaluated. We can also implement if-else-if construct by USING multiple when tag. The when tags are mutually EXCLUSIVE, that means the first when tag which evaluates to true is evaluated and then, the control exits the choose BLOCK. If none of the when condition evaluates to true, then otherwise condition is evaluated. For EXAMPLE <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> JSTL choose, when, otherwise tag: These are conditional tags used to implement conditional operations. If the test condition of the when tag evaluates to true, then the content within when tag is evaluated, otherwise the content within the otherwise tag is evaluated. We can also implement if-else-if construct by using multiple when tag. The when tags are mutually exclusive, that means the first when tag which evaluates to true is evaluated and then, the control exits the choose block. If none of the when condition evaluates to true, then otherwise condition is evaluated. For Example <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> |
|