package com.bjpowernode.handlers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
// 表示当前类是一个处理器
@RequestMapping("/test")
// 命名空间
public class MyController {
@RequestMapping(value="/ajax.do")//与data参数相同(,produces="text/html;charset=utf-8"不能加不然不能传值到ajax)
@ResponseBody
public Object doAjax() {
System.out.println("........");
return new Student("大多数", 11);
}
}
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
// 表示当前类是一个处理器
@RequestMapping("/test")
// 命名空间
public class MyController {
@RequestMapping(value="/ajax.do")//与data参数相同(,produces="text/html;charset=utf-8"不能加不然不能传值到ajax)
@ResponseBody
public Object doAjax() {
System.out.println("........");
return new Student("大多数", 11);
}
}