您的位置:首页 > 其它

标签的引入和beandefine的用法

2007-10-30 19:28 288 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html xhtml="true" lang="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Multibox Example</title>
<html:base />
<link rel="stylesheet" type="text/css" href="../../css/example.css" />
</head>
<body>
<html:link page="/jsp/multibox/source.jsp">
<img src="../../images/code.gif" width="24" height="24" alt="View Source" class="icon" />
</html:link>
<a href="../../index.jsp"><img src="../../images/return.gif" height="24" width="24" alt="Return to examples page" class="icon" /></a>
<h1>Multibox Example</h1>
<hr noshade="noshade"/>
<html:form action="/processMultibox">
<bean:define id="tabInitId" value="5"></bean:define>

<bean:define id="maxTabIndex" value="0"></bean:define>
<logic:iterate name="colors" id="color" indexId="indexId">
<html:multibox property="colors" tabindex="<%=Integer.toString(Integer.valueOf(tabInitId)+8*indexId.intValue()) %>">
<bean:write name="color" />
</html:multibox>
<bean:write name="color" /><br />
<% maxTabIndex = Integer.toString((indexId+1)*8); %>
</logic:iterate>
<hr />
<p>
<html:multibox property="fruits" value="Pineapples" tabindex="<%=Integer.toString(Integer.valueOf(maxTabIndex))%>"/>Pineapple<br />
<html:submit />
<html:cancel />
<html:reset />
</p>
</html:form>

</body>
</html:html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: