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中的拦截器

     

  • 相关阅读:
    osg控制相机移动
    osg绘制胶囊体
    Pset_RampFlightCommon
    osg抓图
    osg截取场景图片
    osg实现三视图
    Sonar系列:Gitlab集成Sonarqube实现自动检测代码并发送报告给提交者(五)
    Sonar系列:通过Jenkins集成sonarqube做持续扫描(四)
    来到这座城市3年了
    DongTai--被动型IAST工具部署体验
  • 原文地址:https://www.cnblogs.com/riskyer/p/3323172.html
Copyright © 2011-2022 走看看