日期:2014-05-17 浏览次数:20778 次
<html> <body> <%@ page language="java" %> <jsp:useBean id="taxbean" scope="application" class="tax.TaxRate" /> <jsp:setProperty name="taxbean" property="*"/> 产品:<jsp:getProperty name="taxbean" property="product"/> <br> 税率:<jsp:getProperty name="taxbean" property="rate"/> </body> </html>
<html> <head> <title>设置产品税率</title> </head> <body bgcolor="#fffffr"> <FORM method="post" action="UseBean.jsp"> <TABLE border=0 cellspacing=1 cellpadding=5> <TR> <td width="100"> </td> <td align="right"><H1><FONT color="red">设置产品税率</FONT></H1></TD> </TR> <TR> <td width="100" align="right"><B><FONT color="blue">产品:</FONT></B></TD> <td align="left"><INPUT TYPE="text" name="product" size="30"></TD> </TR> <TR> <td width="100" align="right"><B><FONT color="blue">税率:</FONT></B></TD> <td align="left"><INPUT TYPE="text" name="rate" size="30"></TD> </TR> <TR> <td width="100"> </TD> <td align="right"></TD> </TR> <TR> <TD width="100"> </td> <td align="left"><input type="submit" value="Submit"></td> </tr> </table> </FORM> </BODY> </HTML>
package tax; public class TaxRate { double rate; String product; public TaxRate(){ } public void setProduct(String ProductName){ this.product=ProductName; } public String getProduct(){ return (this.product); } public void setRate(double rateValue){ this.rate=rateValue; } public double getRate(){ return this.rate;} }
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">