????Spring??mock????????е??????
???????????? ???????[ 2013/8/22 13:26:57 ] ????????
??????????????
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;
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11