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

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
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥50 汇编语言除法溢出问题
  • ¥50 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗