需要帮助运行示例 struts 程序,它抛出“请求的资源不可用”错误。
我使用的是 struts-2.3.24.1 和 Tomcat 8。
Web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>SampleStruts</display-name>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<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>
</web-app>
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.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name="login" class="com.sr.actions.LoginAction" >
<result name="success"> /welcome.jsp </result>
<result name="failed"> /failed.jsp </result>
</action>
</package>
</struts>
请告诉我如何解决该问题。
最佳答案
库依赖关系不一致是依赖管理中最常见的错误。您的项目依赖项中没有重要的库。
需要 commons-lang3-3.1.jar
来解决错误。
关于java - 支柱错误: The requested resource is not available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35516977/