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.
异常信息: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.的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- struts2错误:The Struts dispatcher cannot be found.
struts2错误:The Struts dispatcher cannot be found. The Struts dispatcher cannot be found. This is usua ...
- 解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found
解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found 异常信息: The Struts dispatcher cannot be fou ...
- The Struts dispatcher cannot be found异常的解决方法
系统错误:HTTP Status 500 异常信息:The Struts dispatcher cannot be found. This is usually caused by using St ...
- 用Struts2框架报错:The Struts dispatcher cannot be found
报错信息 The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the ...
- 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: ...
随机推荐
- Echart自定义y轴刻度信息1
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- jQuery实现ie浏览器兼容placeholder效果
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- kali linux之msf客户端渗透
在无法通过网络边界的情况下转而攻击客户端----进行社会工程学攻击,进而渗透线上业务网络 含有漏洞利用代码的web站点--利用客户端漏洞 含有漏洞利用代码的doc,pdf等文档----诱使被害者执行p ...
- C# Winform下一个热插拔的MIS/MRP/ERP框架15(窗体基类场景1)
最基础的窗体基类其实是通过应用场景反推的结构. 以下是场景一: 单表应用,普通的数据,比如单位/颜色/特殊字典等使用者少的,无需过多控制的可以使用一个数据表格来管理. 和Excel表格差不多,批量修改 ...
- 如何从svn下载以前的项目版本
showlog 你的项目,找到最老的log的版本号,然后svn co -r 最老的log的版本号 项目地址
- Oracle中对多行查询结果进行拼接
to_char(wmsys.wm_concat(to_char( st.col_name))) as new_name to_char: 将当前值转换成字符串类型; wmsys.wm_concat:拼 ...
- MySQL8,登陆root后修改root密码的正确方式
如题,·MySQL8以上的修改密码方式和5不一样 网上搜到的无用答案很多,这里记一下版本8的正确修改方式,也方便自己和他人 USE mysql; ALTER user 'root'@'%' IDENT ...
- 02-线性结构4 Pop Sequence (25 分)
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and p ...
- js 常用基本知识
Object.isObject = function(obj){ return obj != null && typeof obj === 'object' && Ar ...
- mkvirtualenv创建python虚拟环境
为什么要创建虚拟环境呢? 如果在我们本地开发好几个项目,每个项目又用到很多第三方插件,如果没没用创建虚拟环境,那么本地项目插件就会很多很乱,如果有虚拟环境就不一样了 虚拟环境安装 pip instal ...