读书人

在weblogic下调试关于JSP调用javabean

发布时间: 2011-12-24 23:03:24 作者: rapoo

在weblogic下调试关于JSP调用javabean的问题
部分代码如下(StudentManager是测试程序项目名称,程序在StudentManager\WEB-INF\classes\com\ydh目录下): 
package com.ydh;
错误① "the character '- ' in the name of this file cannot appear in the java identifier. "

import java.io.*;
import java.sql.*;
public class sqlconn
错误② "the package of this type does not match its location on the source
path:WEB.classes.com.ydh. "

{
.......
}

testSQL.jsp引用代码(testSQL.jsp程序在StudentManager\目录下)如下:
<jsp:useBean id= "dbBean " scope= "page " class= "com.ydh.sqlconn "/>
错误③Type com.ydh.sqlconn contains no methods with this name.

[解决办法]
上面代码和出错信息都写在一起了。以上问题有那位大虾知道,多请指点。

[解决办法]
第一个错误是由于JAVA中没有"-"标识符,可以用"_"
第二个是说包的位置不匹配,没有在src目录下
第三个是说名字为com.ydh.sqlconn的类中没有方法,既然是jsp:useBean,那么在bean类中是否存在对应的set/get方法
[解决办法]
看看。。。。。。。。
[解决办法]
3楼都说了

读书人网 >J2SE开发

热点推荐