@RequestMapping

@RequestMapping("addMenu.action")
public String addMenu(ModelMap map,
@RequestParam(required=false, value="id") String id) {

if (StringUtils.isNotEmpty(id)) {
HgoMenuInfo hgoMenuInfo = hgoMenuInfoService.selectById(id);
map.put("hgoMenuInfo", hgoMenuInfo);
}

return "system/hgo_menu_info/add_menu";
}



RESTful风格

// 匹配单个路径
@RequestMapping("article/details/{id}")
public String blogDetail(ModelMap map,
@PathVariable(value="id") String id) {

return "portal/details";
}

// 匹配多个路径
@RequestMapping(value={"doc/{typeId}", "doc/{typeId}/{docMenuId}"})
public String doc(ModelMap map,
@PathVariable(value="typeId") String typeId,
@PathVariable(required=false, value="docMenuId") String docMenuId) {
map.put("docMenuId", docMenuId);

return "portal/doc/docDetail";
}



@CookieValue

获取指定cookie

@CookieValue(required=false, value="token") String token



回到顶部