基于spring3+hibernate+mvc的架构,页面的request请求,不能到controller方法中。1.request请求页面中的
<form id="" action="/system/dic" method="post">2.controller中处理的代码关键部分为 @Controller
@RequestMapping("/system/dic") public class AttTypeDicController extends AbstractController {@RequestMapping(method = RequestMethod.POST)
public ModelAndView create(HttpServletRequest request,
HttpServletResponse response) {
System.out.println("ssssssssssssss\n");
String s = request.getParameter("ATT_TYPE_ID");
System.out.println(s+"\n");。。就是数据请求不能完成,第一行打印都不能输出
初步判断是不支持象“method="post"”这样的基于方法的匹配,因为当@RequestMapping(method = RequestMethod.POST)改为@RequestMapping("/new"),页面里的form改为action='/system/dic/new'就打印正常。
请问什么情况会导致不支持方法匹配?
<form id="" action="/system/dic" method="post">2.controller中处理的代码关键部分为 @Controller
@RequestMapping("/system/dic") public class AttTypeDicController extends AbstractController {@RequestMapping(method = RequestMethod.POST)
public ModelAndView create(HttpServletRequest request,
HttpServletResponse response) {
System.out.println("ssssssssssssss\n");
String s = request.getParameter("ATT_TYPE_ID");
System.out.println(s+"\n");。。就是数据请求不能完成,第一行打印都不能输出
初步判断是不支持象“method="post"”这样的基于方法的匹配,因为当@RequestMapping(method = RequestMethod.POST)改为@RequestMapping("/new"),页面里的form改为action='/system/dic/new'就打印正常。
请问什么情况会导致不支持方法匹配?
@RequestMapping(method = RequestMethod.POST) 这个是提交方式。
使用的jar包是否完全导入
配置文件一定要仔细配置,有时候‘/’会出现问题,
web.xml中对请求的匹配方式(是*后还是/*),
页面请求的时候用相对路径不可以的话,可以尝试绝对路径,
等等还有一些小的细节问题,你仔细检查。