-
遇到问题“严重: Could not find action or result” 寻求解答5
我在开发struts2 时 遇到 “严重: Could not find action or result ”错误,搞了半天也没有办法解决,请哪位高人能帮我解决一些
一下是具体错误
2008-6-15 19:24:25 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\jdk1.5\bin;E:\apache-tomcat-6.0\bin
2008-6-15 19:24:25 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2008-6-15 19:24:25 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 632 ms
2008-6-15 19:24:25 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2008-6-15 19:24:25 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.13
2008-6-15 19:24:25 org.apache.catalina.startup.HostConfig deployWAR
信息: Deploying web application archive mytest.war
2008-6-15 19:24:26 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-default.xml]
2008-6-15 19:24:27 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-plugin.xml]
2008-6-15 19:24:27 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts.xml]
2008-6-15 19:24:27 org.apache.struts2.config.Settings getLocale
警告: Settings: Could not parse struts.locale setting, substituting default VM locale
2008-6-15 19:24:28 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
信息: Setting DefaultObjectTypeDeterminer as default ...
2008-6-15 19:24:29 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2008-6-15 19:24:29 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2008-6-15 19:24:30 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-default.xml]
2008-6-15 19:24:30 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-plugin.xml]
2008-6-15 19:24:30 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts.xml]
2008-6-15 19:24:30 org.apache.struts2.config.Settings getLocale
警告: Settings: Could not parse struts.locale setting, substituting default VM locale
2008-6-15 19:24:31 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
信息: Setting DefaultObjectTypeDeterminer as default ...
2008-6-15 19:24:33 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-default.xml]
2008-6-15 19:24:33 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts-plugin.xml]
2008-6-15 19:24:33 com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
信息: Parsing configuration file [struts.xml]
2008-6-15 19:24:33 org.apache.struts2.config.Settings getLocale
警告: Settings: Could not parse struts.locale setting, substituting default VM locale
2008-6-15 19:24:35 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
信息: Detected GenericsObjectTypeDeterminer, initializing it...
2008-6-15 19:24:35 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2008-6-15 19:24:35 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2008-6-15 19:24:35 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/94 config=null
2008-6-15 19:24:35 org.apache.catalina.startup.Catalina start
信息: Server startup in 10072 ms
2008-6-15 19:25:07 org.apache.struts2.dispatcher.Dispatcher serviceAction
严重: Could not find action or result
There is no Action mapped for namespace / and action name helloForm. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
2008-6-15 19:25:10 org.apache.struts2.dispatcher.Dispatcher serviceAction
struts.xml 文件如下
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="false"/>
<constant name="struts.i18n.encoding" value="UTF-8"/>
<constant name="struts.action.extension" value="do"/>
<include file="struts-default.xml" />
<package name="default" extends="struts-default">
<action name="HelloAction"
class="com.yourcompany.struts.action.HelloAction">
<result>/form/hello.jsp</result>
</action>
</package>
</struts>
web.xml文件配置如下
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>mytest</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.yourcompany.struts.action</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
问题补充:
也报这个 错There is no Action mapped for namespace / and action name helloAction.
问题补充:
“<action name="HelloAction"
class="com.yourcompany.struts.action.HelloAction">
<result>/form/hello.jsp</result>
</action>
里面没配置 path”
请问 如何配置path,好像 action 中不用配path啊2008年6月15日 20:00
4个答案 按时间排序 按投票排序
-
<action name="HelloAction"
class="com.yourcompany.struts.action.HelloAction">
<result>/form/hello.jsp</result>
</action>
action 的 name 应该是HelloAction,而不是helloForm,helloForm不是HelloAction,
OK?2008年6月19日 13:45
-
<action name="HelloAction"
class="com.yourcompany.struts.action.HelloAction">
<result>/form/hello.jsp</result>
</action>
里面没配置 path2008年6月16日 09:38
-
提示很明确There is no Action mapped for namespace / and action name helloForm. - [unknown location]
helloForm这个action在哪里配置的?2008年6月16日 09:36
相关推荐
2. **警告:Could not find action or result** 这个错误表示在Struts框架中找不到对应的动作映射。确保你的`struts.xml`文件中已经定义了相应的行为映射,例如`<action name="attent" class=...
- FIX: The result rectangle incorrectly calculated in the TFlexText.GetRefreshRect method. - FIX: Added FPaintCache.rcPaint cleanup in the TFlexPanel.WMPaint method. Now it is possible to define is ...
1. Struts框架错误处理:文档中提到的“Dispatcher initialization failed”和“Could not find action or result”等信息表明Struts框架在初始化过程中遇到了问题。这通常发生在web.xml配置不当,或者struts.xml...
Although "Prisoner" does not have a direct correlation with C# programming, it can be related to concepts such as "constrained execution environments" or "jailbreaking" in software development ...
directive because it is not set or is mistyped, a default value will be used. ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one ; of the INI constants (On, Off, True, ...
Key range locks are similar to row locks on index keys (whether clustered or not). The locks are placed on individual keys rather than at the node level. The hash value consists of all the key ...
’ that is, what result(s) the approach is meant to achieve. Sometimes it is difficult to uncover such motivation, especially in operations that have been going on for some time. All too often it ...
point not being scaled or translated. Fixed. + A constant starting with a decimal (eg, .25) caused CurveExpert to bomb (when defining a user model). This has been fixed so that these constants ...
the ability to see how many new mail messages they have, are not supported by POP at all. These capabilities are built into programs like Eudora or Microsoft Outlook, which remember things like the ...
在例句中,"Positive thinking and action result in success.",表示积极的思想和行动会导致成功。 11. practical [præktɪkəl]:形容词,意思是实用的或实际的。在例句中,"The HUNCH program has an impact on...
This is synonymous with deliverable, that is defined as “any measurable, tangible, verifiable outcome, result or item that must be produced to complete a project or part of a project. Often used ...