传参方式

重定向

第一方式:

<action name="search" method="search"
            class="com.BatchFullTextSearchAction" >
            <result name="success" type="redirect">/search/index/task_success.jsp?message=9999999</result>
</action>

<result name="error" type="redirect"> /login.jsp?userId=${orgStrucUser.userId}&amp;error=1  </result>

<result name="success" type="redirect">/search/index/index.jsp?resultType=${#request.module}</result>(BatchFullTextSearchAction action里面定义一个module变量,写上getter、setter方法!)

第二方式:

<result name="error" type="redirect">

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

<param name="userId">${orgStrucUser.userId}</param>

<param name="error">1</param>

</result>

转发(界面request.getAttribute就可以获取到值了)

<action name="search" method="search"
            class="com.BatchFullTextSearchAction" >
            <result name="success" type="dispatcher">/search/index/task_success.jsp</result>
 </action>

struts2 xml配置文件配置传参数的更多相关文章

  1. ssh2的application.xml配置文件配置详解

    ssh2的application.xml配置文件配置详解   1.导入其他的配置文件.在ssh项目中可以导入其他的配置文件,导入的格式为: <import resource="clas ...

  2. JavaWeb_通过xml配置文件配置servlet访问路径

    Servlet两种访问路径 一.在Servlet类中通过设置@WebServlet标注访问 二.在web.xml中编写配置文件 第一种能比较直观看到Servlet路径,但当项目发布后不好再对Servl ...

  3. struts2.xml的配置与技巧

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-/ ...

  4. Struts2.xml的配置

    框架初始知识: Servlet  VS   Filter Filter的性能更强,因为Servlet能实现的,Filter都能实现. Filter还有拦截资源的作用 是Servlet所不能实现的. F ...

  5. Struts2中通过超链接传参数要注意的问题

    写到分页的功能,在传递页码pageNo的时候遇到了参数接收不正确的问题,我本来在action中是定义了一个pageNo字符串参数和一个Page类参数,Page是一个封装了页面要显示的数据集合和页面信息 ...

  6. pom.xml配置文件配置jar(不用记,快速配置)

    1:网址:http://mvnrepository.com/ 2:在搜索栏搜索要用的框架;例如spring *以下为示例

  7. 01_MyBatis EHCache集成及所需jar包,ehcache.xml配置文件参数配置及mapper中的参数配置

     1 与mybatis集成时需要的jar ehcache-core-2.6.5.jar mybatis-ehcache-1.0.2.jar Mybatis.日志.EHCache所需要的jar包如下 ...

  8. struts2基础学习----struts.xml配置文件

    <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "- ...

  9. 03SpringMvc_自定义的spring.xml配置文件和逻辑视图名

    这篇文章的目的是实现Struts2中一种形式(封装视图的逻辑名称),在Struts2中Action处理后会返回"SUCCESS"这样,然后根据"SUCCESS" ...

随机推荐

  1. libevent的hello world程序

    照着例子写了一个简单的libevent hello world代码: #include <sys/signal.h> #include <event.h> void signa ...

  2. 使用Topshelf 5步创建Windows 服务

    使用Topshelf创建Windows 服务简要的介绍了创建Windows服务的另一种方法,老外的一篇文章Create a .NET Windows Service in 5 steps with T ...

  3. C/C++ 语言获取文件大小

    在C语言中测试文件的大小,主要使用二个标准函数. 1.fseek 函数原型:int fseek ( FILE * stream, long int offset, int origin ); 参数说明 ...

  4. Java基础(六):继承

    1.继承的概念: 继承是java面向对象编程技术的一块基石,因为它允许创建分等级层次的类.继承就是子类继承父类的特征和行为,使得子类对象(实例)具有父类的实例域和方法,或子类从父类继承方法,使得子类具 ...

  5. [置顶] 利用Global.asax的Application_BeginRequest 实现url 重写 无后缀

    利用Global.asax的Application_BeginRequest 实现url 重写 无后缀 <%@ Application Language="C#" %> ...

  6. [Node.js] Level 2 new. Event

    Chat Emitter We're going to create a custom chat EventEmitter. Create a new EventEmitter object and ...

  7. 6. Activity life cycle

    An activity can exist in essentially three states: Resumed The activity is in the foreground of the ...

  8. (LeetCode 141/142)Linked List Cycle

    1.Given a linked list, determine if it has a cycle in it. 2.Given a linked list, return the node whe ...

  9. windows、linux mysql部署

    阅读目录: 1.Windows下安装MySQL 2.Linux下安装MySQL 序章: MySQL是个小型的数据库,用来自己做小项目,做学习练习什么的再适合不过了,不过新手总会被一些莫名奇妙的问题难住 ...

  10. Windows 之 防火墙

          对于只使用浏览.电子邮件等系统自带的网络应用程序,Windows防火墙(firewall)根本不会产生影响.也就是说,用IE.OutlookExpress等系统自带的程序进行网络连接,防火 ...