最近做spring开发,个人认为,Controller和客户端js通讯时传递的参数类 只使用某几个方法,为了减少对其他功能的影响,想把参数类定义为Controller类的嵌套类(内部类)。但是实践发现不行。系统会报错: Servlet.service() for servlet ...
最近做spring开发,个人认为,Controller和客户端js通讯时传递的参数类 只使用某几个方法,为了减少对其他功能的影响,想把参数类定义为Controller类的
嵌套类(内部类)。但是实践发现不行。
系统会报错:
Servlet.service() for servlet [kingkoo] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.itl.wms.mvc.systemsetting.POQCSettingController$QueryParameter]: No default constructor found; nested exception is java.lang.NoSuchMethodException: ***************Controller$嵌套类.<init>()] with root cause public class Nest } public static void main(String[] args) throws Exception { private static void NestClassConstrunct()输出:
public App$Nest(App)
原标题:spring 笔记1: mvn 中Controller方法的参数不能是嵌套类(内部类)。
关键词:Spring
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。