1.struts2-spring-plugin.jar作用?
spring整合struts2框架需要的jar包,里面的strtus-plugin.xml配置文件将Action对象生产权交给spring管理
2.<dependency>
作用?
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${struts2.version}</version>
</dependency>
可以使用@Namespace@Action等注解
3.<default-interceptor-ref name="myStack"></default-interceptor-ref>
作用?
配置struts2框架运行时,默认执行的拦截器是struts-default
上面配置在struts.xml中改变默认拦截器为myStack
4.找不到action或者result?
20:54:09,635 ERROR Dispatcher:42 - Could not find action or result
/crm_client/save.action
No result defined for action cn.aj.web.action.UserAction and result input
报警细节:
20:54:09,498 ERROR ParametersInterceptor:34 - Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting ‘car.id’ on ‘class cn.aj.bos.action.CourierAction: Error setting expression ‘car.id’ with value [‘10-20’, ]
20:54:09,571 WARN LocalizedTextUtil:64 - Missing key [invalid.fieldvalue.id] in bundles [[org/apache/struts2/struts-messages, com/opensymphony/xwork2/xwork-messages]]!
20:54:09,572 WARN LocalizedTextUtil:64 - Missing key [invalid.fieldvalue.standard.id] in bundles [[org/apache/struts2/struts-messages, com/opensymphony/xwork2/xwork-messages]]!
可能原因:
原因一:action的路径错误
原因二:ssh框架下,页面返回的数据类型,与模型驱动(属性驱动)中的字段类型不同,比如属性驱动需要Integer类型,但是返回的是String类型