code043.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>javaBean设置属性的值</title>
</head>
<body>
<jsp:useBean id="product" class="pack01.code042"></jsp:useBean>
<jsp:setProperty property="name" name="product" value="洗衣机"/>
<jsp:setProperty property="price" name="product" value="8888"/>
<jsp:setProperty property="count" name="product" value="99"/>
<jsp:setProperty property="factory" name="product" value="广东省某某公司"/>
<table border="1">
<tr>
<td><jsp:getProperty property="name" name="product"/></td>
<td><jsp:getProperty property="price" name="product"/></td>
<td><jsp:getProperty property="count" name="product"/></td>
<td><jsp:getProperty property="factory" name="product"/></td>
</tr>
</table>
</body>
</html>