国产探花免费观看_亚洲丰满少妇自慰呻吟_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>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 太白县| 扎兰屯市| 和龙市| 那曲县| 乌鲁木齐市| 会宁县| 香港| 新泰市| 南宁市| 乐清市| 游戏| 昭平县| 儋州市| 博白县| 吉安市| 永新县| 凉山| 志丹县| 四会市| 汝阳县| 乐清市| 武定县| 讷河市| 郁南县| 姚安县| 东光县| 化州市| 芷江| 广昌县| 泸溪县| 措勤县| 托克托县| 云浮市| 安徽省| 辽宁省| 星子县| 福建省| 冀州市| 阿鲁科尔沁旗| 象州县| 长寿区|