首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

struts2指定欢迎页面替action请求

2012-11-21 
struts2指定欢迎页面为action请求方法一:在index.jsp中用forward跳转执行action步骤 第一步:web.xml中修改

struts2指定欢迎页面为action请求

方法一:在index.jsp中用forward跳转执行action

步骤

第一步:
web.xml中修改
<filter-mapping>
? <filter-name>struts2</filter-name>
? <url-pattern >/*</url-pattern>
? <dispatcher>REQUEST</dispatcher>
? <dispatcher>FORWARD</dispatcher>??
</filter-mapping>
第二步:
web.xml中添加
<welcome-file-list>
? <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
第三步:
首页跳转语句
index.jsp内容如下:
<jsp:forward page="/max/HelloWorld.action"></jsp:forward>

方法二:在index.html中使用META重定向。

操作:<META HTTP-EQUIV="Refresh" CONTENT="0;URL=max/HelloWorld.action">

其中,

content="1 是时间控制,表示1秒后自动跳转到要跳转的页面.
content="0 表示打开该页后立即跳转到你要跳转的页面.
url 是要跳转的路径

?

热点排行