cindylebron 2017-06-06 15:03 采纳率: 0%
浏览 2623

web程序在eclipse中运行报错404

javaweb项目,成功配置Tomcat,之前可以运行登录界面(index.jsp),其他界面的跳转实现不了(404错误),后来Tomcat服务器启动错误,按网上的方法改了server.xml文件中的context行为绝对路径,现在服务器可以启动,但是每个页面都报404错误,求解原因。
可能是web.xml文件有误,也可以是servlet代码部分有问题。
附上各部分代码和目录:
web.xml

<?xml version="1.0" encoding="UTF-8"?>

xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">





This is the description of my J2EE component

This is the display name of my J2EE component

RegisterAction

com.register.RegisterAction





This is the description of my J2EE component

This is the display name of my J2EE component

LoginAction

com.login.LoginAction





This is the description of my J2EE component

This is the display name of my J2EE component

ProductAction

com.product.ProductAction





This is the description of my J2EE component

This is the display name of my J2EE component

LogoutAction

com.logout.LogoutAction



RegisterAction

/servlet/RegisterAction





LoginAction

/servlet/LoginAction





ProductAction

/servlet/ProductAction





LogoutAction

/servlet/LogoutAction

<!-- 配置 过滤器 -->



MyFilter

com.filter.MyFilter



MyFilter

<!-- /*表示过滤所有页面 ,/main.jsp 表示只过滤main.jsp页面-->

/main.jsp





MyFilter

<!-- /*表示过滤所有页面 /addProduct.jsp 表示只过滤addProduct.jsp页面-->

/addProduct.jsp



index.jsp



小女子肝404错误熬了几个晚上了,大作业眼看就要交了,求大神解答~

  • 写回答

4条回答 默认 最新

  • Mr_LuL 2017-06-09 06:12
    关注

    这要看你的登录页面上的 那个路径写对了没

    评论

报告相同问题?

悬赏问题

  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 请求分析基于spring boot+vue的前后端分离的项目
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?