问题:
在Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效了,不但调转不过去还报404错误。不知道是Struts2中不支持还是需要其他的配置。

原因:
因为struts2采用过滤器的方式处理请求,默认情况时监控url地址的变化

解决办法
1、配置web.xml 解决

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern >/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

2、js解决

<script language="javascript">location.replace(URL)</script>

3、利用html meta

<meta http-equiv="refresh" content="0;URL=xxx.action">

Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效的更多相关文章

  1. [原创]java WEB学习笔记16:JSP指令(page,include),JSP标签(forwar,include,param)

    本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...

  2. Struts2中关于"There is no Action mapped for namespace / and action name"的总结

    今天在调试一个基础的Struts2框架小程序.总是提示"There is no Action mapped for namespace / and action name"的错误. ...

  3. struts2中错误There is no Action mapped for namespace [/] and action name [] associated with context path

    1 There is no Action mapped for namespace [/] and action name [] associated with context path [/Stru ...

  4. struts2中 jsp:forward 失败原因及解决办法

    问题:在Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效了,不但调转不过去还报404错误.不知 ...

  5. struts2中<jsp:forward>跳转时报404错误的问题

    index.jsp页面:     <jsp:forward page="show.action"></jsp:forward>      在struts.x ...

  6. <welcome-file>index.action</welcome-file>直接设置action,404和struts2中的解决方案

    这几天的项目页面的访问全部改为.action访问,在修改首页时遇到了问题.将web.xml文件中<welcome-file>index.action</welcome-file> ...

  7. struts2中<welcome-file>index.action</welcome-file>直接设置action,404的解决方案

    这几天的项目页面的访问全部改为.action访问,在修改首页时遇到了问题.将web.xml文件中<welcome-file>index.action</welcome-file> ...

  8. JSP——JavaServer Page中的隐式对象(implicit object)、指令(directive)、脚本元素(scripting element)、动作(action)、EL表达式

    目录 1.JSP概述 2.注释(comment) 2.1.JSP注释 2.2.HTML注释 3.隐式对象(implicit object) 3.1.隐式对象清单 3.2.request对象 3.3.o ...

  9. jsp\struts1.2\struts2 中文件上传(转)

    jsp\struts1.2\struts2 中文件上传 a.在jsp中简单利用Commons-fileupload组件实现 b.在struts1.2中实现c.在sturts2中实现现在把Code与大家 ...

随机推荐

  1. Java HashMap、LinkedHashMap

    如果需要使用的Map中的key无序,选择HashMap:如果要求key有序,则选择TreeMap. 但是选择TreeMap就会有性能问题,因为TreeMap的get操作的时间复杂度是O(log(n)) ...

  2. .NET对象与Windows句柄(三):句柄泄露实例分析

    在上篇文章.NET对象与Windows句柄(二):句柄分类和.NET句柄泄露的例子中,我们有一个句柄泄露的例子.例子中多次创建和Dispose了DataReceiver和DataAnalyzer对象, ...

  3. 20145211 《Java程序设计》课程总结——桃花流水窅然去

    每周读书笔记链接汇总 20145211 <Java程序设计>第1周学习总结--小荷才露尖尖角 20145211 <Java程序设计>第2周学习总结--桃花依旧笑春风 20145 ...

  4. mongo安装、备份与常见命令整理

    http://zlboy888.blog.163.com/blog/static/315357072012919241104/ 1 下载安装包  官方下载地址:http://www.mongodb.o ...

  5. Selenium2学习-026-WebUI自动化实战实例-024-获取页面元素

    非常简单的方法封装,就不啰嗦了,直接上码咯 ^_^ /** * Get element. It will be return null when there is not such element. ...

  6. flex布局中flex-basis|flex-grow|flex-shrink

    flex布局中flex-basis|flex-grow|flex-shrink 整个才是正确的算法 flex-basis(基准值) 可以设置flex布局中容器的宽度,如果同时存在width属性,将把它 ...

  7. [转]Altium Designer 发现的机密

    转载自CrazyBingo博客. 进入电子设个世界,PCB是少不了的东西,刚开始画板子的时候,感觉好神奇.那个时候用的是Altium Designer Summer 08 ,现在用的是Altium D ...

  8. TTL和CMOS

    reprint from:http://blog.csdn.net/hemeinvyiqiluoben/article/details/9253249 TTL和COMS电平匹配以及电平转换的方法 一. ...

  9. 追加文件内容java

    1.向空文件文件中追加内容(如果原来有内容,则覆盖) FileWriter writer; try { writer = new FileWriter(listFile);//创建字符输出流类对象和已 ...

  10. js访sleep方法

    function sleep(n) { var start = new Date().getTime(); while (true) if (new Date().getTime() - start ...