jsp中import自定义类问题

浩渺云烟 发布于 2013/11/06 11:11
阅读 2K+
收藏 0

求教问题:

第一步:在工程下新建包com.holon.controller下新建DBBean.java文件,

第二部:我在jsp文件中<%@ page language="java" pageEncoding="UTF-8" import="com.test.DBBean"%>

中间部分代码为String[][] ss=DBBean.getGoodList(currpage);

编译时出错:

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 14 in the generated java file
Only a type can be imported. com.holon.controller.DBBean resolves to a package

An error occurred at line: 40 in the jsp file: /rightframe.jsp
DBBean cannot be resolved
37:   		String cp=request.getParameter("cp");//cp涓哄垎椤垫暟
38:   		int currpage=(cp==null||cp=="")?1:Integer.parseInt(cp);
39:   		
40:   		String[][] ss=DBBean.getGoodList(currpage);
41:   		for(int i=0;i<ss.length;i++){
42:   	 %>
求教,谢谢
加载中
0
calvary
calvary
DBBean 这个类没有导入进来。。
0
飞炀
飞炀
是 
<%@ page language="java" pageEncoding="UTF-8" import="com.test.conn.*"%>
 吧..
0
震秦
震秦

另起一行写:

<%@page import="com.sdyc.ndcls.model.TranEntity"%>

0
RegnoiX
RegnoiX
Only a type can be imported. com.holon.controller.DBBean resolves to a package

返回顶部
顶部