Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse JET Guide
Previous Page Home Next Page

<c:choose>

Standard JET2 Control Tags

choose

Define a group of mutually exclusive choices. The contents of this tag are restricted to 'when' and 'otherwise' tags only.

During execution of this tag, each 'when' and 'otherwise' tag is evaluated in sequence. If one of these tags evaluates to 'true', then any subsequent tags are ignored. A 'when' tag evaluates to 'true' if its 'test' attribute's XPath expression evaluates to 'true'. An 'otherwise' tag evaluates to 'true' if no preceeding 'when' (or 'otherwise') tag has evaluated to true.


Tag Summary
required <c:choose>
    content to be written
</c:choose>
full tag <c:choose select="value">
    content to be written
</c:choose>

Optional Attributes
select
Optional test expression. When specified, each 'when' tag 'test' expression is tested for equality against this value. When not specified, this is the equivalent of the XPath expression 'true()'.

Example
<%-- evaluate one of a number alternatives --%>
<c:choose>
<c:when test="$var/@value = 1">
    handle case 1
</c:when>
<c:when test="$var/@value >= 2">
    handle case 2
</c:when>
<c:otherwise>
    handle other cases
</c:otherwise>
</c:choose>

<%-- evaluate an expression against constances --%>
<c:choose select="$var/@num">
<c:when test=" 'one' ">
    handle case 'one'
</c:when>
<c:when test=" 'two' ">
    handle case 'two'
</c:when>
<c:otherwise>
    handle other cases
</c:otherwise>
</c:choose>


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire