我使用Tomcat 6并且拥有位于服务器上的jsp文件和java文件 ] 这些是我在服务器上传的所有文件
WEBINF/classes/layar/Testing.java
WEBINF/index.jsp
WEB-INF/lib/alt-rt.jar
WEB-INF/lib/charsets.jar
WEB-INF/lib/deploy.jar
WEB-INF/lib/dt.jar
WEB-INF/lib/javaws.jar
WEB-INF/lib/jce.jar
WEB-INF/lib/jconsole.jar
WEB-INF/lib/jspcontrols-rt.jar
WEB-INF/lib/jsse.jar
WEB-INF/lib/management-agent.jar
WEB-INF/lib/plugin.jar
WEB-INF/lib/resources.jar
WEB-INF/lib/rt.jar
WEB-INF/lib/sa-jdi.jar
WEB-INF/lib/tools.jar
Testing.java文件
package layar;
import java.io.*;
public class easyTesting
{
public void startCode()
{
File f = new File("layertestnew.php");
if(!f.exists())
{
f.createNewFile();
}
else
{
f.delete();
}
}
}
这是index.jsp文件
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Layer Easy testing</title>
</head>
<jsp:useBean id="link" class = "layar.Testing" />
<body>
<form action="poi.jsp" method="post">
<INPUT type="button" value="Create script file" onClick = <%
link.startCode(); %> "window.location.reload()"><br>
<br>
Select POIs type
<div align="left"><br>
<input type="radio" name="poi" value="1" checked > dynamic<br>
<input type="radio" name="poi" value="2">static<br>
<input type="radio" name="poi" value="3"> both<br>
<INPUT type="submit" value="save" ><br>
</div>
</form>
</body>
</html>
当我打开http://79.125.23.143:8080/lezv/index.jsp
时我收到了下一个错误
org.apache.jasper.JasperException: /index.jsp(9,0) The value for the useBean class
attribute layar.Testing is invalid.
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:148)