zoukankan      html  css  js  c++  java
  • DWR在Spring中应用

    这里以传递一个对象为例,来说明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>
    
  • 相关阅读:
    软件测试常见概念
    Apollo简介及工作原理
    bug的编写技巧与级别划分
    native与H5优缺点及H5测试
    优惠券测试
    go语言-for循环
    go语言-流程控制--if
    go语言-二进制与位运算
    cookie和session
    AJAX
  • 原文地址:https://www.cnblogs.com/lvxiaowei/p/4228425.html
Copyright © 2011-2022 走看看