关于struts2当中页面访问404错误

dxh1063745232 2014-06-17 10:19:48

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="default" namespace="/" extends="struts-default">

<default-action-ref name="index" />

<global-results>
<result name="error">/error.jsp</result>
</global-results>

<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error"/>
</global-exception-mappings>

<action name="hello">
<result>
/Hello.jsp
</result>
</action>
</package>
</struts>

上面是struts.xml配置


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
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_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

上面是web.xml配置

当访问http://localhost:8080/Struts2_0100_Introdution/hello.action/就报404错误,各位要是有遇上此种错误过的,请指教,我已经为此研究两天了,实在是不知道问题出在哪里?
...全文
114 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
艾尔乔 2014-06-18
  • 打赏
  • 举报
回复
404 是最简单的问题了 讲究一个人的细心 404 最好还是自己解决这种问题 一般我以前开始404都是action那里错了
dxh1063745232 2014-06-18
  • 打赏
  • 举报
回复
你们说的是Hello.jsp那个页面吗?那个页面就是最基本的webProject自带的jsp,只是改了一下名字。
姜小白- 2014-06-17
  • 打赏
  • 举报
回复
最关键的页面没有贴上来
-江沐风- 2014-06-17
  • 打赏
  • 举报
回复
访问路径的问题吧,还有些代码没贴上来吧

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧