Spring MVC的No parameter specified for @RequestParam异常

今天测试一个程序发现No parameter specified for @RequestParam argument异常。程序是以annotation的方式使用spring mvc开发的。程序在eclipse开发环境下没有问题,但到了正式环境就出错。

问题的解决:正式环境使用ant编译,给ant的compile命令加上debug=true参数。

原因:ant模式是debug=false,所以编译出来的函数声明里的变量名会改变,例如:public String kill(String pid)编译后成为public String kill(String s1)。

这样spring的绑定参数名就不work了。

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>