useBean 类属性 ****** 的值无效
我使用 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)
I use Tomcat 6 and have jsp file and java file which is located on the server
]
These are all files which I upload on the server
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 file
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();
}
}
}
this is index.jsp file
<!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>
And when I open http://79.125.23.143:8080/lezv/index.jsp
I get the next error
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论