dwr配置spring的配置过程如下,以strust1为例,其它与C这块也没有什么关系
首先在web.xml中添加
我以我的配置为例
然后在dwr.xml文件中可以添加配置信息如下
spring配置文件
配置过程很简单,调用方便,如果在页面上想调用spring生成的bean的话,可以采用这种方式。
首先在web.xml中添加
我以我的配置为例
<!--初始化WebApplicationContext-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/et/config/spring/applicationContext.xml,/WEB-INF/classes/et/config/spring/spring*.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- dwr配置 -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<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>
<!-- end dwr 配置 -->
然后在dwr.xml文件中可以添加配置信息如下
<!-- 得到短信和传真的消息列表 -->
<create javascript="showMessageList" creator="spring">
<param name="beanName" value="showMessageList"/>
</create>
spring配置文件
<!-- 显示消息列表 -->
<bean id="showMessageList" class="et.bo.xunhuan.ShowMessageList">
<property name="xunhuanI">
<ref bean="XunhuanI" />
</property>
</bean>
配置过程很简单,调用方便,如果在页面上想调用spring生成的bean的话,可以采用这种方式。