1. Put the package of DWR mainly dwr.jar; (copy the package in the Demo WAR in DWR to your application), there is another Xalan.jar package (this package is not included in the DWR Demo WAR) Copy to the application's web-inf / lib directory 2. Modify the web.xml file, which is as follows: Code:
XML Version = "1.0" encoding = "UTF-8"?>
XMLns = "http://java.sun.com/xml/ns/j2ee" XMLns: xsi = "http://www.w3.org/2001/xmlschema-instance" XSI: SchemAlocation = "http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "> init-param> servlet> servlet-maping> web-app> 3. Write the dwr.xml file to save the code with the same directory with Web.xml: XML Version = "1.0" encoding = "GB2312"?>
Value = "com.ceun.demo" /> create> allow> dwr> 4. Write com.ceun.Demo class code: Package com.ceun; Public class demo { Public string hello () { Return "Hello"; } } 5. Write JSP code: <% @ page language = "java" PageEncoding = "GB2312"%>