国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JSP > 正文

struts2 action跳轉調用另一個程序

2024-09-05 00:20:57
字體:
來源:轉載
供稿:網友
主要為了在一個Action成功后跳轉調用另一個程序,需要的朋友可以參考下

目的:主要為了在一個Action成功后跳轉調用另一個程序。
Struts2.xml
[html]

復制代碼 代碼如下:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts> <!-- 指定為開發模式(默認值為false) -->
<constant value="false" />
<constant value="UTF-8"/>
<constant value="message"></constant>
<!-- 上傳文件臨時文件位置 -->
<constant value="c:/"></constant>
<!--
<include file="com/lanstar/config/struts/struts_user.xml"/>
-->
<package namespace="/" extends="struts-default">
<action>
<result name = "success">/jsp/uploadresult.jsp</result>
</action>
<action class = "uploadAction">
<result type= "chain">
<param>analysisAction</param>
</result>
<!--<result name = "success">/jsp/uploadresult.jsp</result>
--><result name = "input">/jsp/Upload.jsp</result>
<result>/jsp/error/error.jsp</result>
<interceptor-ref>
<!-- 單個上傳文件的最大值-->
<param>409600</param>
<!-- 只能上傳的文件的類型,可到tomcat的web-xml中查看各種文件類型-->
<param>text/html,application/msword</param>
</interceptor-ref>
<interceptor-ref></interceptor-ref>
</action>
</package>
</struts>


Spring.xml
[html]

復制代碼 代碼如下:


<!--
- Application context definition for JPetStore's business layer.
- Contains bean references to the transaction manager and to the DAOs in
- dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation").
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans




">
<!-- service start -->
<bean scope="prototype">
</bean>
<bean scope="prototype">
</bean>
</beans>


兩種方式:
需要保存前一個action的屬性信息時使用:
[java]

復制代碼 代碼如下:


<result type= "chain"><param>analysisAction</param></result>


不保存前一個action的參數可以用這種方法:
[java]

復制代碼 代碼如下:


<result type= "redirect-action"><param>analysisAction</param></result>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 疏勒县| 贵阳市| 仲巴县| 乌拉特后旗| 章丘市| 安图县| 旺苍县| 敦化市| 平湖市| 舟曲县| 平阴县| 亳州市| 平远县| 炉霍县| 马龙县| 弥勒县| 宁陵县| 尤溪县| 高台县| 黔西县| 临朐县| 民和| 陆河县| 施甸县| 油尖旺区| 红河县| 日土县| 丰宁| 桐梓县| 开阳县| 楚雄市| 彰武县| 繁昌县| 华池县| 嘉黎县| 巴彦淖尔市| 杭锦后旗| 白朗县| 巴塘县| 彭山县| 大兴区|