??????????????

java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16?? mixed mode?? sharing)

????spring??汾??3.1.0.RELEASE

????spring-mock??汾??1.2.6

????????Spring ???mvc

?????????

@Controller
@RequestMapping("/case")
public class CaseController {
 @RequestMapping(value = "/list"?? method = RequestMethod.POST)
 public String list(HttpServletRequest request?? HttpServletResponse response) {
  String name = request.getParameter("name");
  request.setAttribute("name"?? name);
  List<String> result = new ArrayList<String>();
  result.add("result1");
  result.add("result2");
  result.add("result3");
  request.setAttribute("result"?? result);
  return "case/list";
 }

 @RequestMapping(value = "/listJson"?? method = RequestMethod.POST)
 @ResponseBody
 public List<String> listJson(HttpServletRequest request?? HttpServletResponse response) {
  String name = request.getParameter("name");
  List<String> result = new ArrayList<String>();
  result.add("result1");
  result.add("result2");
  result.add("result3");
  return result;
 }

}