这是代码。
@RequestMapping("/searchGood")
public String searchGood(@RequestParam("goodName") String goodname,
ModelMap m,HttpServletResponse response, HttpServletRequest request) throws Exception {
Cookie cookie = new Cookie("goodName",goodname);
cookie.setPath("/");
cookie.setMaxAge(3600);
response.addCookie(cookie);
m.put("list", searchservice.search(goodname));
return "search";
}
------解决方案--------------------
楼主在浏览器里想怎么查看cookie呢?
------解决方案--------------------
在这个路径下找一找C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files
------解决方案--------------------
cookie是再次发送HTTP请求的时候才会带上的...........
------解决方案--------------------
Firefox浏览器,按F12键,打开开发者工具,切换到cookie标签,里面可以查看cookie
其它浏览器的开发者工具,也有相应的功能