The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.

异常信息: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.

环境:tomcat5.5.0

struts.xml信息

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="2.4"  
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
  <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>*.action</url-pattern> 
  </filter-mapping> 
  <welcome-file-list> 
    <welcome-file>index.jsp</welcome-file> 
  </welcome-file-list> 
</web-app> 
         struts.xml 信息:

<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"
<struts> 
  <include file="struts-default.xml"/> 
  <package name="ygn.action" extends="struts-default"> 
    <action name="HelloWorld" class="ygn.action.HelloWorld"> 
      <result>HelloWorld.jsp</result> 
    </action> 
  </package> 
</struts> 
       SayHello.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%> 
<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<title>Say Hello</title> 
</head> 
<body> 
  <h3>Say "Hello" to :</h3> 
  <s:form action="HelloWorld"> 
    Name:<s:textfield name="name"/> 
    <s:submit/> 
  </s:form> 
</body> 
</html>

异常分析:以上的配置及文件中,如果采用 http://ip:port/SayHello.jsp,那么会出现前面所提到的异常。如果采用http://ip:port/SayHello.action 进行访问,那么正常。

原因:如果想要在jsp文件中,采用 struts的tag,那么必须通过web.xml所配置的过滤器访问文件,否则会有异常,即 之前所出现的异常。

解决方案:

方案一:

采用 http://ip:port/SayHello.action 访问

方案二:

将web.xml 的过滤器,从 *.action 修改为: /*

方案三:

修改SayHello.jsp 文件,不使用 struts 的标签。

The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.的更多相关文章

  1. The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. 异常

    异常信息如下: The Struts dispatcher cannot be found. This is usually caused by using Struts tags without t ...

  2. The Struts dispatcher cannot be found. This is usually caused by using Struts

    对于struts2中的问题: org.apache.jasper.JasperException: The Struts dispatcher cannot be found. This is usu ...

  3. The Struts dispatcher cannot be found. This is usually caused by using Struts ta

    HTTP Status 500 - type Exception report message description The server encountered an internal error ...

  4. The Struts dispatcher cannot be found. This is usually caused by using Strut

    The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc ...

  5. struts2错误:The Struts dispatcher cannot be found.

    struts2错误:The Struts dispatcher cannot be found. The Struts dispatcher cannot be found. This is usua ...

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

    解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found 异常信息: The Struts dispatcher cannot be fou ...

  7. The Struts dispatcher cannot be found异常的解决方法

    系统错误:HTTP Status 500 异常信息:The Struts dispatcher cannot be found.  This is usually caused by using St ...

  8. 用Struts2框架报错:The Struts dispatcher cannot be found

    报错信息 The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the ...

  9. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has p

    2014-09-16 15:47:51.590:WARN:oejs.ErrorPageErrorHandler:EXCEPTION org.apache.jasper.JasperException: ...

随机推荐

  1. Mysql数据类型《三》枚举类型与集合类型

    枚举类型与集合类型 字段的值只能在给定范围中选择,如单选框,多选框 enum 单选 只能在给定的范围内选一个值,如性别 sex 男male/女female set 多选 在给定的范围内可以选择一个或一 ...

  2. myeclipse上down出的svn项目,文件后面不显示版本号和修改人

    找到 windows ->preferences->General->Appearance->Lable Decorations 下拉找到svn 勾选上

  3. Flink学习笔记:Flink API 通用基本概念

    本文为<Flink大数据项目实战>学习笔记,想通过视频系统学习Flink这个最火爆的大数据计算框架的同学,推荐学习课程: Flink大数据项目实战:http://t.cn/EJtKhaz ...

  4. 函数新特性、内联函数、const详解

    一.函数回顾与后置返回类型 函数定义中,形参如果在函数体内用不到的话,则可以不给形参变量名字,只给其类型. 函数声明时,可以只有形参类型,没有形参名 把函数返回类型放到函数名字之前,这种写法,叫前置返 ...

  5. CH5101 LCIS

    CH5101 LCIS 题意: 求两个长度不超过3000的序列的最长公共上升子序列 思路: 朴素解法:用f[i,j]表示a1~ai与b1~bj可以构成的以bj为结尾的LCIS的长度,三重循环求解: ; ...

  6. Kettle配合Windows执行计划实现定时实行作业

    一般作业做好后需要做成定时任务,Kettle可以借助Windows的执行计划来完成.那么可以通过写批处理的方式让执行计划来调用. 其中Kitchen和Pan都可以做定时执行,一个是针对作业,一个是针对 ...

  7. 接口自动化之unittest+ddt

    我在上一篇(https://www.cnblogs.com/wlyhy/p/10083318.html) 文章整理了unittest的模板,但在后续学习中,发现还有许多值得优化的地方.例如在我们设计测 ...

  8. python全栈开发学习_day1_计算机五大组成部分及操作系统

    一.计算机五大组成部分: 1)五大组成: 1.控制器(指挥系统,用于控制其他计算机硬件的工作) 2.运算器(用于数学运算及逻辑运算) 3.存储器(寄存器,高速缓存,内存,磁盘(机械,固态),磁带) 4 ...

  9. C#集合之集(set)

    包含不重复元素的集合称为“集(set)”..NET Framework包含两个集HashSet<T>和SortedSet<T>,它们都实现ISet<T>接口.Has ...

  10. Oracle 客户端安装

    Oracle 客户端的安装方式一种有两种: 1.Oracle标准客户端   点击下载 这是Oracle提供的标准版11r2的客户端 2.Oracle Database Instant Client(即 ...