@Controller @RequestMapping("/nvg") public class NavigationController { private Logger logger = LoggerFactory.getLogger(getClass()); @RequestMapping("/{path}") public ModelAndView navigation1(@PathVariable("path") String path) { logger.debug("orgEditDialog"); ModelAndView view = new ModelAndView("org/"+path); return view; } } 或者 @RequestMapping("/nvg") public class NavigationController { private Logger logger = LoggerFactory.getLogger(getClass()); @RequestMapping("/myPageName")//(1) public ModelAndView navigation1(@PathVariable("path") String path) { logger.debug("orgEditDialog"); ModelAndView view = new ModelAndView("org/myPageName"); //(2) return view; } }
不明白,为什么(1)跟(2)一定要一样,才能访问,否则找不到这个model。
$("#orgHomeIncludeDiv").load("nvg/orgEditDialog", paramters, function (response, status, xhr) { if(status!="success"&&status!="notmodified"){ $.WebUtil.error("无法获取请求的资源.","提示信息"); } });