Error???
--------------------------------------------------------------------------------
我用jbuilder编译出现以下错误的原因在哪?如何解决
java.lang.NullPointerException
--------------- nested within: ------------------
"index.jsp": weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested exception:
[java.lang.NullPointerException]
java.lang.NullPointerException
--------------- nested within: ------------------
indexbean.java文件:
package tds;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class IndexBean {
private String sample = "Start value";
//Access sample property
public String getSample() {
return sample;
}
//Access sample property
public void setSample(String newValue) {
if (newValue != null) {
sample = newValue;
}
else {
sample = "Start value";
}
}
}
index.jsp文件:
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
index
</title>
</head>
<jsp:useBean id="indexBeanId" scope="session" class="tds.IndexBean" />
<jsp:setProperty name="indexBeanId" property="*" />
<body bgcolor="#ffffff">
<h1>
JBuilder Generated JSP
</h1>
<form method="post">
<br>Enter new value : <input name="sample"><br>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
<br>
Value of Bean property is :<jsp:getProperty name="indexBeanId" property="sample" />
</form>
</body>
</html>