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

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

    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮