多dwr.xml文件的配置
可能有几种情况: 一个servlet,多个dwr.xml配置文件;多个servlet,每个servlet对应一个或多个dwr.xml.
一个 servlet,多个dwr.xml配置文件;
代码
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>config-1</param-name>
<param-value>WEB-INF/dwr1.xml</param-value>
</init-param>
<init-param>
<param-name>config-2</param-name>
<param-value>WEB-INF/dwr2.xml</param-value>
</init-param>
</servlet>
【注意】
在这种配置下,param-name的值必须以 config开头。param-name可以有>=0个。如果没有param-name,那么将会读取WEB-INF/dwr.xml。如果有大于 零个param-name,那么WEB-INF/dwr.xml文件将不会被读取。
多个servlet,每个servlet对应一个或多个 dwr.xml
========================================================
多个servlet,每个servlet对应一个或多个dwr.xml.
代码
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<!--用classes/dwr.xml-->
</servlet>
<servlet>
<servlet-name>dwr-invoker1</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>config-admin</param-name>
<param-value>WEB-INF/dwr1.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dwr-invoker1</servlet-name>
<url-pattern>/dwr1/*</url-pattern>
</servlet-mapping>