dwrフレームワーク構成


web.xml構成

<servlet> 
<servlet-name>dwr-invoker</servlet-name> 
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> 
<!--     DWR   false。    true,      http://localhost:port/app/dwr        DWR class。      java             。      ,                false。-->
<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> 

jspでのインポート

<!--  TestClass.js dwr           ,engine.js util.js dwr       。 -->
<script src='dwr/interface/TestClass.js'></script> 
<script src='dwr/engine.js'></script> 
<script src='dwr/util.js'></script> 

dwr.xml構成

<!--     List、Set  Map java   -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC
    "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
    "http://getahead.org/dwr/dwr20.dtd">
<dwr> 
<allow> 
<create creator="new" javascript="testClass" > 
<param name="class" value="com.dwr.TestClass" /> 
<include method="testMethod6"/> 
</create> 
<convert converter="bean" match="com.dwr.TestBean"> 
<param name="include" value="username,password" /> 
</convert> 
</allow> 
</dwr> 
<!--  :  List、Set  Map          (      Double,Float ) String、Date、       ,    <convert>  。-->

<!--   List、Set  Map   java   -->
<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE dwr PUBLIC   
    "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"   
    "http://getahead.org/dwr/dwr20.dtd">  
<dwr> 
<allow> 
<create creator="new" javascript="testClass" > 
<param name="class" value="com.dwr.TestClass" /> 
<include method="testMethod7"/> 
</create> 
<convert converter="bean" match="com.dwr.TestBean"> 
<param name="include" value="username,password" /> 
</convert> 
</allow> 
<signatures> 
<![CDATA[ 
import java.util.List; 
import com.dwr.TestClass; 
import com.dwr.TestBean; 
TestClass.testMethod7(List<TestBean>); 
]]> 
</signatures> 
</dwr>