Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

, , tag

, , tag

JSP Standard Label LibraryJSP Standard Tag Library

These tags work like the Java switch statement, used to make a choice among many options.

A switch statement has case, while thetag correspondingly has, and a switch statement has default, while thetag has。

Syntax format





    

        ...

    

    

        ...

    

    ...

    ...

    

        ...

    



property

The attributes of the tag are as follows:

property Description Whether it is required Default value
test Conditional Is None

Example Demonstration



<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>





c:choose 标签实例







你的工资为 :

太惨了。 不错的薪水,还能生活。 什么都没有。

The running result is as follows:



你的工资为 : 4000



不错的薪水,还能生活。


JSP Standard Label LibraryJSP Standard Tag Library