`
lgstarzkhl
  • 浏览: 329065 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
社区版块
存档分类
最新评论

dwr配置spring

阅读更多
dwr配置spring的配置过程如下,以strust1为例,其它与C这块也没有什么关系
首先在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的话,可以采用这种方式。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics