Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效
问题:
在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>失效的更多相关文章
- [原创]java WEB学习笔记16:JSP指令(page,include),JSP标签(forwar,include,param)
本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...
- Struts2中关于"There is no Action mapped for namespace / and action name"的总结
今天在调试一个基础的Struts2框架小程序.总是提示"There is no Action mapped for namespace / and action name"的错误. ...
- 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 ...
- struts2中 jsp:forward 失败原因及解决办法
问题:在Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效了,不但调转不过去还报404错误.不知 ...
- struts2中<jsp:forward>跳转时报404错误的问题
index.jsp页面: <jsp:forward page="show.action"></jsp:forward> 在struts.x ...
- <welcome-file>index.action</welcome-file>直接设置action,404和struts2中的解决方案
这几天的项目页面的访问全部改为.action访问,在修改首页时遇到了问题.将web.xml文件中<welcome-file>index.action</welcome-file> ...
- struts2中<welcome-file>index.action</welcome-file>直接设置action,404的解决方案
这几天的项目页面的访问全部改为.action访问,在修改首页时遇到了问题.将web.xml文件中<welcome-file>index.action</welcome-file> ...
- 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 ...
- jsp\struts1.2\struts2 中文件上传(转)
jsp\struts1.2\struts2 中文件上传 a.在jsp中简单利用Commons-fileupload组件实现 b.在struts1.2中实现c.在sturts2中实现现在把Code与大家 ...
随机推荐
- Python 时间 日期常见操作
import datetime,time dtstr = '2014-02-14 21:32:12' a = datetime.datetime.strptime(dtstr, "%Y-%m ...
- Silverlight4-安装顺序(VS2010)
1.vs2010 2. Silverlight4_Tools 3.Silverlight_Developer 4.Microsoft Expression Blend Preview for Silv ...
- appium testcase2
自己跑的两个case都在盘里,可以直接解压后放到workspace,加载工程就能跑,前提是你的环境没有问题 http://pan.baidu.com/s/1bnHCyn1 eclipse-File-i ...
- TestNG学习-002-annotaton 注解概述及其执行顺序
此文主要讲述用 TestNG 基础的 annotation (注解)知识,及其执行的顺序,并通过一个 TestNG 简单的实例演示 annotation 的执行顺序. 希望能对初学 TestNG 测试 ...
- sell- 获取邮箱的后缀
1. public static void main(String[] args) { System.out.println(getEmailSuffix("jim_chen28270@16 ...
- 请问下./在Linux下是什么意思
请问下./在Linux下是什么意思 http://zhidao.baidu.com/link?url=1f-80KN7cdi-7XECpwXLUn6Ps4reMBL2zB6eiDk7JliwDgW6k ...
- Java IO读取文件之二
package com.lf.iopreoject; import java.io.BufferedReader; import java.io.File; import java.io.FileIn ...
- ASP.NET MVC Template
http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html http://st ...
- 【转】用CSS代码写出的各种形状图形的方法
一共收集整理了图形20个,比较实用,同时也为了熟悉CSS的代码.整合了一下,有错误欢迎指出. 1.正方形 #square {width: 100px;height: 100px;background: ...
- [Call Vibrator] How to Enable Outgoing Call Vibration without ROOT
Call Vibrator requires the radio log of phone to detect when outgoing call is answered. But since An ...