jsp:useBean出錯,求高手指點
代碼如下,當加上 <jsp:useBean時提示錯誤如下
java.lang.UnsupportedClassVersionError: Bad version number in .class file
去掉 <jsp:useBean時能正確執行
<%@ page language= "java " contentType= "text/html; charset=BIG5 " %>
<%@ page import= "java.sql.* " %>
<html>
<head>
<title> test </title>
</head>
<body>
<jsp:useBean id= "login " class= "com.sun.LoginBean " scope= "session "> </jsp:useBean>
<label> helloworld </label>
</body>
</html>
------解决方案--------------------把com.sun.LoginBean的包改一下:比如
com.yourcompany.LoginBean看看。
------解决方案--------------------编译jdk和运行的jre版本不一致