result的类型

转向

<result type="dispatcher">

<param name="location" > .......</param>

</result type="dispatcher">

重定向到jsp

<result type="redirect">

<param name="location">.......</param>

</result type="redirect">

重定向到action

<result type="redirectAction">

<param name="actionName">.....</param>

<param name="namespace">....</param>

</result type="redirectAction">

通配符的使用:

*可替代相同位置  变化的地方      其他地方不变

{1}{2}分别对应第一个*传过来的值和第二个*传过来的值

{0}表示通配符的整个子串..

在xml文件中

<action name="*_*" class="it.cast.demo.{1}"   method="{2}">

<result name="success">

/{1}.jsp

</result>

</action>

动态方法调用:

action中不配置method

浏览器调用时通过:命名空间+actionName+!+方法名+后缀的方法进行调用

<a href=" ${pageContext.request.ContextPath}/primer/HelloWordAction!getObj.action" />

struts2的知识的更多相关文章

  1. Struts2入门1 Struts2基础知识

    Struts2入门1 Struts2基础知识 20131130 代码下载: 链接: http://pan.baidu.com/s/11mYG1 密码: aua5 前言: 之前学习了Spring和Hib ...

  2. struts2 相关知识

    struts2学习笔记 1.struts.properties struts.properties 是可以不要的!!!因为 struts.xml文件中 有 <constant> 这个节点, ...

  3. (二)Struts2 核心知识

    所有的学习我们必须先搭建好Struts2的环境(1.导入对应的jar包,2.web.xml,3.struts.xml) 第一节:Struts2 get/set 自动获取/设置数据 action代码: ...

  4. 经典MVC框架技术-struts2基础知识

    Struts2框架简介 struts2框架是在struts1和webwork技术的基础上,进行合并的全新框架,struts2以Webwork为核心,采用拦截器来处理用户的请求,这样的设计使得业务逻辑控 ...

  5. struts2学习(2)struts2核心知识

    一.Struts2 get/set 自动获取/设置数据 根据上一章.中的源码继续. HelloWorldAction.java中private String name,自动获取/设置name: pac ...

  6. struts2学习(4)struts2核心知识III

    一.result配置: result - name 就是前面返回的值,success,error等. type: dispatcher. 默认是这个,底层是jsp的forward: redirect: ...

  7. struts2学习(3)struts2核心知识II

    一.struts.xml配置: 1.分模块配置方法: 比如某个系统多个模块,我们把资产管理模块和车辆管理模块,分开,在总的struts.xml配置文件中include他们: 工程结构: struts. ...

  8. Struts2基础知识

    1.什么是Struts2框架? 答:struts2是一款优秀的mvc框架,集中解决了Controlller的相关问题,解决了部分视图相关的问题(struts2标签): mvc 是一种思想,包括Mode ...

  9. Struts2 源码分析——前言

    笔者简言 笔者在博园里面注册是在二年前.可是那个时候我不知道要写些什么,也怕写出来被别人骂误人子弟.而现在却动笔了是因为前一段时间内我去参加一些大公司的面试,让笔者内心深处留下很多问号.最近三年来我一 ...

随机推荐

  1. main方法执行之前,做什么事

    1.我们知道程序的入口是main方法,那么在执行main方法之前,需要做些什么准备工作呢? 2.main方法执行之前,必须要把non-local static对象构造完成.static对象有:全局对象 ...

  2. Chrome Apps将可以打包成iOS或Android应用

    Chrome Apps 将可以在 iOS 和 Android 设备上独立运行了.开发者只要使用 Google今天 提供的工具集(toolchain)将自己的 Web App 打包,并将生成的应用上传到 ...

  3. 关于c#调用C++代码的一些应用的体会

    1.dll函数的导入:    关键字:unmanaged code ; managed code;    具体应用类:System.Runtime.InteropServices    具体使用方法: ...

  4. delphi 08 HTML组件

    ///HTML组件///后面的字符串为这个控件的ID号///直线          Line         (WebBrowser1.Document as IHTMLDocument2).exec ...

  5. seajs 2.3.0 加入jquery

    [前言] 上篇文章简单的介绍了seajs的使用,下午使用seajs整合jquery就碰到问题了. 下载seajs上的examples,里面直接require('jquery')没有不论什么问题, 我照 ...

  6. [MODx] 2. Install some useful packages into ur MODx

    1. The package we might need: 2. Install the package: Select Installer Download Extras Install the p ...

  7. oc-05-对象的创建

    // 11-[掌握]创建一个对象并访问成员变量 #import <Foundation/Foundation.h> //声明 @interface Person : NSObject//类 ...

  8. 错误解决:release' is unavailable: not available in automatic reference counting mode

    解决办法: You need to turn off Automatic Reference Counting. You do this by clicking on your project in ...

  9. UNIX标准化及实现之限制

    前言 UNIX系统实现定义了很多幻数和常量,其中有很多已被硬编码(关于硬编码和软编码:http://www.cnblogs.com/chenkai/archive/2009/04/10/1432903 ...

  10. C# 之 将string数组转换到int数组并获取最大最小值

    1.string 数组转换到 int 数组 " }; int[] output = Array.ConvertAll<string, int>(input, delegate(s ...