dwr-invoker org.directwebremoting.servlet.DwrServlet debug true dwr-invoker /dwr/*
"-//GetAhead Limited//DTD Direct Web Remoting 3.0//EN" "http://getahead.org/dwr/dwr20.dtd">
package com.ning.dwr.test;import java.util.ArrayList;import java.util.List;public class DwrDemo { public List getHello(String name){ List list = new ArrayList(); list.add(name); list.add("你好!"); list.add("list测试第三条!"); return list; }}
<%@ page language="java" cOntentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%> DWR功能测试 提交
(1)处理后台传来的数据--String,List,Map等;采用如下两种方法都可以;
var data;data = { username:"zhangsan" , password:"123456"};