在Struts中,通过action跳转jsp,但是有时希望仅仅只是跳转页面,而不需要action,这时可以用ForwardAction。

定义一个仅仅是跳转的ForwardAction如下:

        <action-mappings>
<!-- 请求的URL对应于<action>中的path属性 -->
<action path="/newHelloWorld"
type="org.apache.struts.actions.ForwardAction"
parameter="/JSP/newHelloWorld.jsp" />
</action-mappings>

这样,在浏览器中输入newHelloWorld.do,就会立即跳转到newHelloWorld.jsp页面。

注:如果发生找不到ForwardAction类的错误,则要包含struts-extras-1.3.10.jar包。

Struts之ForwardAction的更多相关文章

  1. Struts ForwardAction Example

    In Struts MVC model, you have to go thought the Action Controller to get a new view page. In some ca ...

  2. Struts核心技术简介

    Struts核心技术简介 1.Struts内部机制   Struts是一种基于MVC经典设计模式的开发源代码的应用框架,它通过把Servlet.JSP.JavaBean.自定义标签和信息资源整合到一个 ...

  3. Struts 笔记 内部资料 请勿转载 谢谢合作

    Struts 概述 随着MVC 模式的广泛使用,催生了MVC 框架的产生.在所有的MVC 框架中,出现最早,应用最广的就是Struts 框架. Struts 的起源 Struts 是Apache 软件 ...

  4. 教你如何精通Struts:Tiles框架

    Tiles框架特性和内容 Tiles框架为创建Web页面提供了一种模板机制,它能将网页的布局和内容分离.它允许先创建模板,然后在运行时动态地将内容插入到模板中.Tiles 框架建立在JSP的inclu ...

  5. Struts – Multiple configuration files example

    Many developers like to put all Struts related stuff (action, form) into a single Struts configurati ...

  6. Configure a welcome page in Struts

    Every website need a welcome or default page as an entry point. Here's 3 ways to configure a welcome ...

  7. Struts DynaActionForm example

    The Struts DynaActionForm class is an interesting feature to let you create a form bean dynamically ...

  8. Struts – MappingDispatchAction Example

    Struts MappingDispatchAction class is used to group similar functionality into a single action class ...

  9. DispatchAction和ForwardAction

    添加功能的步骤:做页面——编写DAO类中的方法——编写和配置action. 如果多个action 使用一个formbean,这种事儿多发生在统一模块中,就可以用一个Action集中处理多个操作,而不要 ...

随机推荐

  1. POJ 1733 Parity game (并查集)

    Parity game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6816   Accepted: 2636 Descr ...

  2. 碎片化时代:O2O服务成最大趋势

    从86年第一封电子E-Mail发出至今28个年头,中国互联网从单一点对点,点对多,多对多,如今又回归到点对点,从最基础的Mail.黄页应用到基于互动的Search.Blog以及基于满足人类基本需求的沟 ...

  3. Android 百度地图开发(一)--- 申请API Key和在项目中显示百度地图

      标签: Android百度地图API Key  分类: Android 百度地图开发(2)    最近自己想研究下地图,本来想研究google Map,但是申请API key比较坑爹,于是从百度地 ...

  4. asp.net ajax 调用错误解决

    ajax调用aspx页面出现如下错误 前台源代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

  5. text-overflow:ellipsis; 使用

    ul li{ height:25px; line-height:25px; width:200px; overflow:hidden; white-space:nowrap;-moz-text-ove ...

  6. c# list排序

    List<int> tmp = new List<int>(){5,1,22,11,4}; 升序:tmp.Sort((x, y) => x.CompareTo(y)); ...

  7. js中的scroll和offset 的使用比较

    1.offsetTop     :当前对象到其上级层顶部的距离.不能对其进行赋值.设置对象到页面顶部的距离请用style.top属性. 2.offsetLeft    :当前对象到其上级层左边的距离. ...

  8. WCF之Host宿主

    Self_hosting自托管宿主. 过程:手动创建Host实例,把服务端点添加到Host实例上,把服务接口与Host关联. 一个Host只能指定一个服务类型,但是可以添加多个服务端点,也可以打开多个 ...

  9. ubuntu 12.04 安装 codeblock 12.11

      原文地址:http://qtlinux.blog.51cto.com/3052744/1136779 参考文章:http://blog.csdn.net/dszsy1990/article/det ...

  10. bzoj2395[Balkan 2011]Timeismoney最小乘积生成树

    所谓最小乘积生成树,即对于一个无向连通图的每一条边均有两个权值xi,yi,在图中找一颗生成树,使得Σxi*Σyi取最小值. 直接处理问题较为棘手,但每条边的权值可以描述为一个二元组(xi,yi),这也 ...