spring mvc 配置 MultiActionController InternalPathMethodNameResolver,该怎么解决

spring mvc 配置 MultiActionController InternalPathMethodNameResolver
exception

javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:744)
root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext resource [/WEB-INF/springmvc-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'empMultiController' defined in ServletContext resource [/WEB-INF/springmvc-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'commandClass' of bean class [com.mvc.controller.EmpMultiController]: Bean property 'commandClass' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'empMultiController' defined in ServletContext resource [/WEB-INF/springmvc-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'commandClass' of bean class [com.mvc.controller.EmpMultiController]: Bean property 'commandClass' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?


root cause


org.springframework.beans.NotWritablePropertyException: Invalid property 'commandClass' of bean class [com.mvc.controller.EmpMultiController]: Bean property 'commandClass' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

请教大家,这个错误怎么解决?
------解决方案--------------------
empMultiController这个bean里,没有叫commandClass 这个成员。
楼主请把MultiActionController这个类贴一下
------解决方案--------------------
引用:
我觉得不需要在EmpMultiController中对Emp配置set  get方法吧!!!!

不需要set get方法。
但<property name="xxx"> xxx是你类里的成员变量的名字。
根据你的代码commandClass 是EmpMultiController类的一个成员变量;
但你的EmpMultiController代码里,是没有 叫commandClass 的变量的,因此,很可能是存在你的父类里面。
那你的父类就是MultiActionController。
所以,我想看看MultiActionController类,你可以down一下spring的源码,就能看到这个类的内容。

个人怀疑是,可能是spring的版本不对。
------解决方案--------------------
引用:
Quote: 引用:

http://blog.csdn.net/crazy1235/article/details/28440583

这个类的源代码太长了,我放到上面那个连接里 了?

我感觉不是版本的问题吧
、?~~~~我也不确定!

我去扫了一下源码,你这样试试
把配置文件里的那个commandClass 换成 command

sorry,我刚才自己去down了一下代码,你需要把这<property name="commandClass">整行去掉,就没问题了。