travelService travelService=new travelServiceImpl();
@RequestMapping(value = "/active",produces ="text/html;charset=utf-8")
@ResponseBody
public String active(String activeCode/*HttpServletRequest request, HttpServletResponse response*/) throws ServletException, IOException{
/*String activeCode = request.getParameter("activeCode");*/
boolean b = travelService.findByCode(activeCode);
if (b){
return "激活成功,请<a href='http://localhost:8080/travel/login.html'>登录</a>";
}else {
return "激活失败";
}
}
@ReponseBody
@RequestMapping(value="/active", produces =“application/text;charset=utf-8”)
可以在requestMapping中制定produces =“text/html;charset=utf-8” 来解决