zoukankan      html  css  js  c++  java
  • 解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found

    解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found

     

    异常信息:
    The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]

     

    jsp中使用了struts的标签,如果这边只拦截action的话,那就会出现jsp中struts标签无法解析的情况,找不到struts的分发器dispatcher,这通常是由于使用了struts标签,而没有配置相关联的filter。struts标签只有在http请求通过标签的servlet filter过滤器之后才可用,这些过滤器用来为这些标签初始化struts分发器

     

    解决办法:


    1.引入
    <%@ taglib prefix="s"  uri="/struts-tags" %>

     

    2.在web.xml中未将拦截的*.action改成/*
    Xml代码 
    <filter> 
        <filter-name>struts2</filter-name> 
       <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>    
    </filter> 
    <filter-mapping> 
        <filter-name>struts2</filter-name> 
    <url-pattern>/*</url-pattern> 
    </filter-mapping> 

     

    我当时出错就是第二种情况,是没有改WEB.XML中的拦截器

     

  • 相关阅读:
    后缀树到后缀自动机
    bzoj 4199 品酒大会
    BZOJ 4310 跳蚤
    BZOJ 4545 DQS的Trie
    BZOJ 3238 差异
    BZOJ 3277 串
    BZOJ 3926 诸神眷顾的幻想乡
    线程与进程
    SparkSql自定义数据源之读取的实现
    spark提交至yarn的的动态资源分配
  • 原文地址:https://www.cnblogs.com/riskyer/p/3323172.html
Copyright © 2011-2022 走看看