警告: Could not find action or result No result defined for action com.study.persistent.services.EmployeeAction and result list at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
“Exception occurred during processing request: No result defined for action com.study.persistent.services.EmployeeAction and result list”这句话的意思是:在处理请求时发生异常,没有找到要返回的result:list。com.study.persistent.services.EmployeeAction中返回的是list,代码如下:
@Controller public class EmployeeAction { @Resource private EmployeeService employeeService; public String execute() { ActionContext.getContext().put("employees", employeeService.list()); return "list"; } }
接下来就要到struts2配置文件struts.xml中找到相应的Action(本例为employeeAction ,因为使用了spring注解)进行排查,struts.xml配置文件如下:
<package name="employee" namespace="/employee" extends="struts-default"> <!-- 此时action开始由spring进行创建和管理,因此不用写上action的类名.需要写上action在spring中的简单类名 --> <!-- 形如:http://localhost:8080/ssh/employee/list.action --> <action name="list" class="employeeAction"> <result>/WEB-INF/page/employee.jsp</result> </action> <!-- 形如:http://localhost:8080/ssh/employee/manage_addUI.action --> <action name="manage_*" class="employeeManageAction" method="{1}"> <result name="add">/WEB-INF/page/employeeAdd.jsp</result> <result name="message">/WEB-INF/page/message.jsp</result> </action> </package>
发现<result>/WEB-INF/page/employee.jsp</result>缺少了name属性,将其修改为:<result name="list">/WEB-INF/page/employee.jsp</result>
相关推荐
在IT领域,尤其是在Web开发中,遇到“No result defined for action”这类错误是常见的问题,尤其当使用Struts2框架时更为突出。此类错误通常指向在控制器(Action)中未正确配置或实现结果集(Result),导致请求...
### Struts2框架中“No result defined for action and result input”错误解析及解决方法 #### 错误概述 在Struts2框架中开发Web应用程序时,可能会遇到一个名为“No result defined for action and result input...
Zabbix 新版微信告警配置攻略,肯定是你需要的,有故障即时通知
在Hadoop分布式文件系统(HDFS)的运行过程中,可能会遇到一个常见的错误,即"ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes"。这个错误通常意味着系统在尝试启动...
通往U Defined Cloud之路.pdf
RF and Digital Signal Processing for Software-Defined Radio: A Multi-Standard Multi-Mode Approach by Tony J. Rouphael RF and Digital Signal Processing for Software-Defined Radio: A Multi-...
### Artech.House_2002_Simulation.and.Software.Radio.for.Mobile.Communications #### 重要知识点解析 **标题与描述中的知识点** - **Artech House**: 这是一家著名的出版商,专注于电信、无线通信及信息技术...
C++经典错误之already defined in *.obj解决方法 C++经典错误之already defined in *.obj解决方法是一种常见的链接错误,发生在编译器链接阶段。该错误的典型症状是:在链接阶段,编译器报告多个符号已经定义,例如...
Of course, if you are wondering whether this book is going to teach you how to create amazing websites or incredible applications, the answer is "no"—that is a job for other books. So many books out...
You will learn how to use vSphere virtualization in a software-defined approach, which will help you to achieve a fully-virtualized infrastructure and to extend this infrastructure for compute, ...
OLE(Object Linking and Embedding)是Microsoft开发的一种技术,它允许不同应用间的对象进行嵌入和链接。在C++ Builder中,可以使用ActiveX(OLE的后续版本)组件来实现这一功能,比如创建和操作Excel表格、Word...
SQL is full of difficulties and traps for the unwary. You can avoid them if you understand relational theory, but only if you know how to put that theory into practice. In this book, Chris Date ...
从书名 SDN:Software Defined Networks 可以看出,作者 Thomas.D.Nadeau 聚焦于 SDN 的概念、原理以及在现代网络中的应用。通过详细阐述 SDN 的核心特点和优势,本书旨在为读者提供关于软件定义网络的深入理解,并...
Programmer-Defined Classes and Objects 476 Section 11.1. Declaring Objects and Classes 476 Section 11.2. A More Useful Class Accessor and Mutator Methods 487 Section 11.3. Constructor ...
### "Value too large for defined data type" 解决办法 在Linux环境下进行文件操作时,可能会遇到一个名为“Value too large for defined data type”的错误。这一问题通常发生在使用`ls`或`find`命令来查看大于2...
JAVA 一个包:org-apache-commons-lang.jar