日期:2014-05-17 浏览次数:20682 次
package com.dwr.test; public class DwrTest { public void testMethod1(){ System.out.println("hello dwr!"); } }
<script type="text/javascript" src="${pageContext.request.contextPath}/dwr/interface/test.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/dwr/engine.js"></script> <script type="text/javascript" src="${pageContext.request.contextPath}/dwr/util.js"></script> <script type="text/javascript"> function method1(){ test.testMethod1(); /*alert(test.testMethod1());*/ } </script>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://www.getahead.ltd.uk/dwr/dwr20.dtd" > <dwr> <allow> <create creator="new" javascript="test" > <param name="class" value= "com.dwr.test.DwrTest" /> </create> </allow> </dwr>