我的项目部署之后,在jsp中使用<%@ page import="com.example.demo.userDao" %>访问我的java类出现org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [14] in the generated java file: [/www/server/bt_tomcat_web/ip地址/work/Catalina/ip地址/ROOT/org/apache/jsp/poetry/index_jsp.java]Only a type can be imported. com.example.demo.userDao resolves to a packageAn error occurred at line: [10] in the jsp file: [/poetry/index.jsp]userDao cannot be resolved to a type而访问HttpServlet或者是springmvc则会出现404:源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示。但是访问jsp中没有引用到WEB-INF/classes/com/example/demo下的class文件,就没有问题,仿佛使用WEB-INF/classes/com/example/demo下的class文件就会报错,代码应该是对的,因为项目在之前的宝塔中运行是没有问题的 |
|