基于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'就打印正常。
请问什么情况会导致不支持方法匹配?

解决方案 »

  1.   

    请问什么情况会导致不支持方法匹配? Spring web本来就不支持方法匹配。Struts才支持的。@RequestMapping(method = RequestMethod.POST)  这个是提交方法。
      

  2.   

    @RequestMapping(method = RequestMethod.POST)  这个是提交方法。==》
    @RequestMapping(method = RequestMethod.POST)  这个是提交方式。
      

  3.   

    三大框架集成的时候,能否运行成功主要因素:
    使用的jar包是否完全导入
    配置文件一定要仔细配置,有时候‘/’会出现问题,
    web.xml中对请求的匹配方式(是*后还是/*),
    页面请求的时候用相对路径不可以的话,可以尝试绝对路径,
    等等还有一些小的细节问题,你仔细检查。
      

  4.   

    spring2.5以后基于注解的 方式是可以进行方法注解的,不知我的是配置文件还是哪儿有点问题?
      

  5.   

    请高手现身,http://www.docin.com/p-47831389.html 参考这篇文章做的 ,就是类库版本可能和文章作者的不太一致,我的是spring3.0.2
      

  6.   

    以前用的2.0,的确现在spring支持方法匹配了。你的问题我看了下,了解注解的@RequestMapping(method = RequestMethod.POST)改为@RequestMapping("/new")===》@RequestMapping("/new",method = RequestMethod.POST)  你在试试
      

  7.   

    现在经过尝试,value 和 method配合使用可以,但单独使用method不行
      

  8.   

    @RequestMapping(“create”,method = RequestMethod.POST)