这里以传递一个对象为例,来说明dwr在Spring中是怎么配置的。
JSP页面: <script src=‘dwr/interface/instructionOuterService.js‘></script> <script src=‘dwr/engine.js‘></script> <script src=‘dwr/util.js‘></script> var instructionOuter = { id: 1, name: ‘myName‘ }; //设置同步 DWREngine.setAsync(false); instructionOuterService.checkSameIns(instructionOuter,function(date){ return ; }); Dwr.xml文件: <create creator="spring" javascript="instructionOuterService"> <param name="beanName" value="instructionOuterService" /> <include method="checkSameInsById" /> </create> <convert converter="bean" match="com.nstc.wst.model.InstructionOuter"> <param name="include" value="id,name" /> </convert> Spring配置: <bean id="instructionOuterService" class="com.nstc.wst.server.InstractionCheckService" autowire="byName"> <property name="paymentHelper"><ref bean="paymentHelper"/></property> </bean>
时间: 2024-10-11 06:13:09