struts2提取公共工具类方法

xiaoxiao2021-02-28  97

类名: QueryAddressActionUtil.java

1:struts.xml:-----<include file="com/common/zx/commonqueryzx.xml" />

2:beans_actions.xml:------<property name="queryAddressActionUtil" ref="queryAddressActionUtil"></property>

<bean id="queryAddressActionUtil" class="com.common.zx.QueryAddressActionUtil" scope="prototype" parent="basePageAction">         <property name = "queryAdrsInfoService" ref="queryAdrsInfoService" />     </bean>

3:commonqueryzx.xml 

<?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> <package name="commonQueryzx" extends="injectionInterceptor-0"> <global-results> <result name="error">/500.jsp</result> </global-results> <global-exception-mappings> <exception-mapping result="error" exception="java.lang.Exception"></exception-mapping> </global-exception-mappings> <action name="QueryAddress" class="queryAddressActionUtil" method="QueryAddress"> </action> </package> </struts>

4:moveaddress.xml:-----<action name="QueryAddress" class="queryAddressActionUtil" method="QueryAddress"></action>

转载请注明原文地址: https://www.6miu.com/read-69311.html

最新回复(0)