struts错误:请求的资源不可用 [英] struts error: The requested resource is not available

查看:474
本文介绍了struts错误:请求的资源不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行示例struts程序时需要帮助,它正在抛出请求的资源不可用错误。

Need help in running the sample struts program, it is throwing "The requested resource is not available" error.

我正在使用struts-2.3.24.1和Tomcat 8。

I am using struts-2.3.24.1 and 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>

请告诉我如何解决此问题。

Please let me know how to resolve the issue.

推荐答案

不一致的库依赖项在依赖项管理中最常见的错误。您在项目依赖项中没有重要的库。

Inconsistent library dependencies most popular error in dependencies management. You don't have an important library in the project dependencies.

commons-lang3-3.1.jar 是需要解决错误。

了解如何使用Maven创建Struts应用程序

这篇关于struts错误:请求的资源不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆