【问题标题】:jasper exception. The Struts dispatcher cannot be found [duplicate]碧玉例外。找不到 Struts 调度程序[重复]
【发布时间】:2020-05-03 17:18:02
【问题描述】:

我有两个 JSP 文件:

  • index.jsp(没有 Struts 2 标签)
  • login.jsp(带有 Struts 2 标签)

我已经用<a href="login.jsp">LOGIN IN</a> 标签链接到login.jspindex.jsp

点击时页面不加载,而是抛出错误:

(ERROR:org.apache.jasper.JasperException: The Struts dispatcher cannot be found.). 

如果从login.jsp 中删除所有struts 标签,它就可以正常工作。

web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
        <filter>
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>

        </filter>

        <filter-mapping>
            <filter-name>struts2</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
    </web-app>

如何运行带有 Struts 2 标签的应用程序?

【问题讨论】:

    标签: java struts2


    【解决方案1】:

    如果页面上有 S2 标签,则必须通过操作访问它。

    S2 标签需要来自框架的数据。

    【讨论】:

      猜你喜欢
      • 2020-08-02
      • 1970-01-01
      • 2011-01-24
      • 1970-01-01
      • 2012-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多