java - 贾斯珀异常(exception)。找不到 Struts 调度程序

标签 java struts2

我有两个 JSP 文件:

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

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

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

(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 标签的应用程序?

最佳答案

如果页面上有 S2 标记,则必须通过操作才能到达该页面。

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

关于java - 贾斯珀异常(exception)。找不到 Struts 调度程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61578658/

相关文章:

java - 使用struts在下拉列表中设置默认值

Java:实现 hashCode() 以确保 int 数组的排列始终返回相同的哈希值

jquery - Ajax jquery 和 struts2 拦截器的参数

java - struts 2中如何避免页面超时?

java - 在 android 应用程序中读取 mp3 标签

java - Struts2 将 SUCCESS 结果 fork 到不同的 JSP

java - 高级通配符操作从 URL 中删除逗号?

Java:从命令行运行的问题

java - 为什么在java中多重继承是不可能的

java - 使用 Apache Commons CLI 库时如何获取参数