我收到错误消息:“只能导入类型。XYZ解析为包。”
有人在这里解释了原因,但是我不确定应该如何解决。仅供参考:我正在使用Eclipse。我在下面添加了执行导入的代码。java.util。*导入可以正常工作。
<%@ page import="java.util.*"%>
<%@ page import="org.eresearch.knowledgeportal.model.Category"%>
<%@ page import="org.eresearch.knowledgeportal.dao.CategoryDao"%>
<%
CategoryDao catDao = new CategoryDao();
ArrayList<Category> catList = catDao.selectCategory();
//
%>
编辑:实际错误如下:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 7 in the generated java file
Only a type can be imported. org.eresearch.knowledgeportal.model.Category resolves to a package