我得到:
com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could not find action or result There is no Action mapped for namespace [/] and action name [] associated with context path [/]. - [unknown location]
我结合使用 RAD + WebSphere 进行开发,代码如下:
struts.xml:
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.custom.i18n.resources" value="ApplicationResources" />
<package name="default" extends="struts-default" namespace="/">
web.xml:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>
我已经阅读了所有博客并尝试了网站上提到的所有内容。这是一个错误,因为我无法找到的某些不同原因。
最佳答案
操作名称 []
和命名空间 [/]
没有配置。这是个问题。要解决这个问题,您应该添加一个配置。假设您在根文件夹中有一个 index.jsp
文件。使用无操作结果,您可以重定向到此页面。
<package name="default" extends="struts-default" namespace="/">
<action name=""><result>/index.jsp</result></action>
...
关于java - 找不到操作或结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30932742/