⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testselectoptiontag.jsp

📁 100多M的J2EE培训内容
💻 JSP
字号:
<%-- Page Directives --%>
<%@ page session="false" errorPage="Error.jsp" %>

<%-- Taglib Directives --%>
<%@ taglib uri="/bibleTags" prefix="bible" %>

<html>
<head>
	<title>Test Select Option Tag</title>
</head>

<body>
<%@ include file="Header.jsp" %>
  
	<h3>SelectOption with single value</h3>
<%-- Set color for testing purpose only --%>
<% String color = "2"; %>
	Color:&nbsp;
	<select name="color">
  	<bible:selectOption value="<%= color %>">
    	<option value="0">--Select One--</option>
    	<option value="1">Red</option>
    	<option value="2">Green</option>
    	<option value="3">Blue</option>
    	<option value="4">Yellow</option>
    	<option value="5">Orange</option>
  	</bible:selectOption>
	</select>
	&nbsp;(value selected = <%= color %>)
 
	<h3>SelectOption with multiple values</h3>
<%-- Set colors for testing purpose only --%>
<%
String[] colors = new String[2];
colors[0] = "1"; 
colors[1] = "4"; 
%>
	Colors:&nbsp;
	<select name="colors" size="6" multiple>
  	<bible:selectOption value="<%= colors %>">
    	<option value="0">--Select Multiple--</option>
    	<option value="1">Red</option>
    	<option value="2">Green</option>
    	<option value="3">Blue</option>
    	<option value="4">Yellow</option>
    	<option value="5">Orange</option>
  	</bible:selectOption>
	</select>
	&nbsp;(values selected = 
<%
boolean needComma = false;
for (int i = 0; i < colors.length; i++) {
  if (needComma) out.print(", ");
  out.print(colors[i]);
  needComma = true;
} %>
)

<br><br>

<%@ include file="Footer.htm" %>
 
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -