java ee 部署问题 ,访问jsp报错

用eclipse导出一个war文件,把文件放在我自己电脑搭建的tomcat/webapps 目录下,访问jsp文件可以访问,一切正常。但是我把整个项目拷贝到老师搭建的服务器上,访问jsp(import了JavaBean类)报错。目录应该怎样才是正确的,jsp要在要配置web.xml吗?
图片描述
图片描述

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>PYQ</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <filter>
    <filter-name>EncodingFilter</filter-name>
    <filter-class>filter.EncodingFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>EncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

tomcat重启后,报错如下。ClassNotFoundException,可是刷新有时又出现上面的错误。
图片描述

阅读 4.9k
1 个回答

如果在本地没有问题,只是换了一个tomcat,那么大多是tomcat的问题,请提供一下tomcat的conf/server.xml配置信息

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进