<!--
<create creator="spring" javascript="dwrShowStyle" scope="page">
<param name="class" value="com.fids.ssh.dao.showstyleDao"/>
<include method="showStyleData"/>
</create>
-->
<!-- convert标签是为了javascript可以调用有javabean参数的java方法
<convert converter="bean" match="com.fids.ssh.entity.Showstyle">
</convert>
-->
上面是DWR.xml的配置,用于前台js来调用Service实现类
或者DWR整合spring,配置在spring中
<?xml version="1.0" encoding="UTF-8"?>
<!--
配置系统基础环境
showstyle模块
author:cheney
-->
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
<bean id="showStyleDao" class="com.fids.ssh.showstyle.ShowStyleDaoImpl" parent="daoBase">
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<bean id="showStyleService" class="com.fids.ssh.showstyle.ShowStyleServiceImpl">
<property name="showStyleDao" ref="showStyleDao"></property>
</bean>
<bean id="showStyle" class="com.fids.ssh.showstyle.ShowStyleAction" scope="prototype" parent="actionBase">
<property name="showStyleService" ref="showStyleService"></property>
</bean>
<!-- DWR配置 -->
<dwr:configuration>
<!-- convert标签是为了javascript可以调用有javabean参数的java方法 -->
<dwr:convert type="bean" class="com.fids.ssh.entity.Showstyle"></dwr:convert>
</dwr:configuration>
<dwr:controller id="dwrController" debug="true" />
<!-- StyleDwrController 这个类算是个DWR控制类-->
<bean id="ajax" class="com.fids.ssh.dwr.StyleDwrController">
<dwr:remote javascript="dwrShowStyle">
<dwr:include method="showStyleData" />
<dwr:include method="addStyle"/>
</dwr:remote>
<property name="showStyleService" ref="showStyleService"></property>
</bean>
</beans>
package com.fids.ssh.dwr;
import java.util.List;
import com.fids.ssh.entity.Showstyle;
import com.fids.ssh.showstyle.ShowStyleService;
public class StyleDwrController {
private ShowStyleService showStyleService;
/**
*
* 读取样式信息
*/
public Showstyle showStyleData(String type){
//........
return null;
}
public boolean addStyle(String htmlCode){
//........
return bflag;
}
public ShowStyleService getShowStyleService() {
return showStyleService;
}
public void setShowStyleService(ShowStyleService showStyleService) {
this.showStyleService = showStyleService;
}
}
分享到:
相关推荐
dwr与 spring整合 传对象的例子
源码 博文链接:https://callan.iteye.com/blog/166986
配置整合DWR3.0和Spring2.5使用annotation注解
spring整合DWR的一些配置问题,如下: 1、web.xml中加入dwr配置 2、由spring接管dwr,配置spring的xml文件 3、配置dwr的service 4、配置页面
DWR配置文件详解 DWR配置 DWR配置文件
描述了spring和dwr配置文件的详细信息,dwr可以让JavaScript调用运行JAVA程序,可以方便我们的使用
精心整理的,dwr与目前流行框架spring和struts2的整合,值得一学
这两个部分是笔者在“疯狂Java实训营”的培训讲义,是《疯狂Ajax讲义:Prototype/jQuery+DWR+Spring+Hibernate整合开发》的重点部分。第三部分则提供了2个综合性案例:Blog系统和电子拍卖系统,让读者将前面所学真正...
ssh dwr 整合配置ssh dwr 整合配置ssh dwr 整合配置
extjs dwr hibernate spring 整合的树!
DWR学习笔记和与spring整合练习,DWR学习笔记和与spring整合练习,DWR学习笔记和与spring整合练习,DWR学习笔记和与spring整合练习,
Spring+Dwr+Hibernate整合项目,包括所需要的包和数据库
DWR整合Spring MVC ,前端jsp文件调用后台java方法,适合DWR学习
验证码 spring+dwr !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1111!
dwr2.0 spring 3.0 整合示例
DWR+SPRING整合应该有地方用的到
spring使用annotation整合dwr笔记 spring使用annotation整合dwr笔记 spring使用annotation整合dwr笔记
自己动手整合的Spring + Springmvc + Mybatis + dwr(mysql 数据库) +JNDI+log4j
Spring与dwr的整合 环境是Myeclipse7.5 希望对大家有用!!!!
struts2 spring ibatis dwr整合配置 自己整合的,很好用