大家好,又见面了,我是你们的朋友全栈君。 JSP1 <body> <form id=”form1″ name=”form1″ method=”post” action=”Sum2.jsp”> 对输入的两个数字之间的数进行累加求和 <br> 初值:<input type=”text” name=”start” value=””><br> 末值:<input type=”text” name=”end” value=””><br> <br> <input type=”submit” name=”tijiao” value=”提交”> <input type=”reset” name=”chongzhi” value=”重置”> </form> </body>
JSP2
<body> <jsp:useBean id=”s1″ scope=”page” class=”ExBean.Sum”/> <jsp:setProperty name=”s1″ property=”start” param=”start”/> <jsp:setProperty name=”s1″ property=”end” param=”end”/> <jsp:setProperty name=”s1″ property=”sum” value=”0″/> <br> 初值: <jsp:getProperty name=”s1″ property=”start”/><br> 末值: <jsp:getProperty name=”s1″ property=”end”/><br> 累加结果: <jsp:getProperty name=”s1″ property=”sum”/><br> </body>
javabean文件 package ExBean;
public class Sum {
private int start; private int end; private int sum;
public void setStart(int start) {this.start=start;}
public int getStart() {return start;}
public void setEnd(int end) { this.end=end; }
public int getEnd() {return end;}
public void setSum(int sum) {this.sum=start;}
public int getSum() {for(int i=0;i<=end;i ) {sum =i;} return sum;
}
}
网页运行转到求和界面时候报错 org.apache.jasper.JasperException: Cannot find any information on property ‘start’ in a bean of type ‘ExBean.Sum’ 在exbean.sum的bean类型中找不到关于属性“start”的任何信息?这是什么意思?
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/157793.html原文链接:https://javaforall.cn