急!求助,javaBean的问题
我的Java报错:
org.apache.jasper.JasperException: /test.jsp(32,2) GetProperty: Mandatory attribute property missing
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:284)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:470)
org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1063)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2220)
org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164)
org.apache.jasper.compiler.Validator.validate(Validator.java:1484)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
全部代码如下:
<Test.java>
package tom.jiafei;
import java.io.*;
public class Test
{
String fileName= " ",//存放考题文件名字的字符串
correctAnswer= " ", //存放正确答案的字符串
testContent= " ", //存放试题的字符串
selection= " "; //客户提交的答案的字符串
int score=0;
public void setFileName(String name){
fileName=name;
selection= " ";
score=0;
}
public String getFileName(){
return fileName;
}
public String getCorrectAnswer(){//读取试题文件的第一行:标准答案
try{
File f=new File( "D:/2000 ",fileName);
FileReader in=new FileReader(f);
BufferedReader buffer=new BufferedReader(in);
correctAnswer=(buffer.readLine()).trim();//读取第一行去掉前后空格
buffer.close();
in.close();
}
catch(Exception e){}
if(selection.length()> 0)
return correctAnswer;
else
return "提交答案后,可以看到正确答案 ";
}
public String getTestContent(){
StringBuffer temp=new StringBuffer();
try{
if(fileName.length()> 0){
File f=new File( "D:/2000 ",fileName);
FileReader in=new FileReader(f);
BufferedReader buffer=new BufferedReader(in);
String str=buffer.readLine();//该行不显示给用户
while ((str=buffer.readLine())!=null){//读出全部题目
temp.append( "\n "+str);
}
buffer.close();
in.close();
}
}
catch(Exception e){}
return " <TextArea rows=15 cols=80&g