displayproduct.jsp

来自「Java EE 5 许多新功能都包含经过修补的 EJB 架构」· JSP 代码 · 共 86 行

JSP
86
字号
<!--
Copyright 2006 Borys Burnayev

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html:html locale="true">
<head>
	<title>
		<bean:message key="welcome.title" />
	</title>
	<html:base />
	<link rel="stylesheet" type="text/css" href="../css/petstore.css" />
</head>
<body bgcolor="white" class="bodystyle" topmargin="0" leftmargin="0" bottommargin="0" rightmargin="0">
	<table  cellspacing="1" cellpadding="4">
		<tr class="tableHeader">
			<th>
				Item ID
			</th>
			<th>
				Item Name
			</th>
			<th>
				Price
			</th>
			<th></th>
		</tr>
		<logic:iterate id="item" name="product" property="items" type="com.rdacorp.petstore.domain.Item">
			<tr class="tableRow">
				<td>
					<bean:write name="item" property="code" />
				</td>
				<td>
					<html:link action="/displayItem" paramId="itemCode" paramName="item" paramProperty="code">
						<bean:write name="item" property="description" />
					</html:link>
				</td>
				<td>
					<bean:write format="$#,##0.00;$(#,##0.00)" name="item" property="price" />
				</td>
				<td>
					<logic:greaterThan name="item" property="availableQuantity" value="0">
						<html:link action="/addItem" paramId="itemCode" paramProperty="code" paramName="item">
							<html:img src="images/addtocart.gif" alt="Add to Cart" border="0" />
						</html:link>
					</logic:greaterThan>
					<logic:lessEqual name="item" property="availableQuantity" value="0">
						<div>
							Out of Stock
						</div>
					</logic:lessEqual>
				</td>
			</tr>
		</logic:iterate>
		<tr class="tableHeader">
			<th>
				&nbsp;
			</th>
			<th>
				&nbsp;
			</th>
			<th>
				&nbsp;
			</th>
			<th>
				&nbsp;
			</th>
	</table>
</body>
</html:html>

⌨️ 快捷键说明

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