bean的问题
jsp1.jsp
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
jsp1
</title>
</head>
<jsp:useBean id="jsp1BeanId" scope="session" class="first.Jsp1Bean" />
<jsp:setProperty name="jsp1BeanId" property="*"/>
<body bgcolor="#ffffff">
<h1>
JBuilder Generated JSP
</h1>
<form method="post" action=jsp1.jsp>
<br>Enter new value1 : <input name="sample" type="text"><br>
<br>Enter new value2 : <input name="sample2" type="text"><br>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
<br>
Value1 of Bean property is :<jsp:getProperty name="jsp1BeanId" property="sample1"/>
Value1 of Bean property is :<jsp:getProperty name="jsp1BeanId" property="sample2"/> //没有它就不会出错!!!!!!!!!!!!!!!!!!!!
</form>
</body>
</html>
first.Jsp1Bean
package first;
import java.io.*;
public class Jsp1Bean implements Serializable
{
private String sample = "Start value";
private String sample2 = "Start value2";
//Access sample property
public String getSample() {
return sample;
}
//Access sample property
public void setSample(String newValue) {
if (newValue!=null) {
sample = newValue;
}
}
public String getSample2() {
return sample2;
}
//Access sample property
public void setSample2(String newValue) {
if (newValue!=null) {
sample2 = newValue;
}
}
}
"jsp3.jsp": org.apache.jasper.JasperException: Cannot find any information on property 'sample2' in a bean of type 'first.Jsp1Bean'
代码很简单的.大家仔细看看为什么?
还有在jb9下怎么对单个的.jsp文件调试?发现它总是会把所有jsp文件编译一编。