spring2.5.5,我怎样才能不返回一个页面,返回一个null?
return "common/county";
我试了void,返回一个默认的county.jsp;return null也不行。
[code="java"]
@Controller
public class CountyController {
@Autowired
private CommonService commonService;
@RequestMapping("/county.html")
public String listItems(Model model, County county, HttpServletResponse response){
if(county.getID() == 0){
county.setID(1);
}
county = commonService.getCounty(county.getID());
StringBuffer sb = CountyUtil.spliceCounties(new ArrayList(county.getChildren()), county);
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.setContentType("text/html; charset=GBK");
out.println(sb.toString());
return "common/county";
}
}
[/code]
mvc配置文件
[code="java"]
[/code]