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

The tags have the same function as the Java switch statement. A switch statement has case statements, while thetag has thetag. A switch statement has a default statement, while thetag has thetag.

Syntax format



 

     ...

 

 

     ...

 

     ...

     ...

 

     ...

 



property

The attributes of the tag:

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

 

Example Demonstration



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

    pageEncoding="UTF-8"%>

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

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







  JSTL x:choose 标签





Books Info:

Padam History ZARA 100 Great Mistry NUHA 2000 Book is written by ZARA Book is written by NUHA Unknown author.

The running result is as follows:



BOOKS INFO:

Book is written by ZARA


JSP Standard Label LibraryJSP Standard Tag Library