解决struts2中UI标签出现的问题: The Struts dispatcher cannot be found
2013-09-15 20:27
639 查看
解决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中的拦截器
异常信息:
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中的拦截器
相关文章推荐
- The Struts dispatcher cannot be found在struts2中出现的问题
- The Struts dispatcher cannot be found在struts2中出现的问题
- The Struts dispatcher cannot be found在struts2中出现的问题
- the Struts dispatcher cannot be found. 在struts2中出现的问题
- The Struts dispatcher cannot be found. 在页面使用struts2的标签时报的异常
- struts2常见标签异常:The Struts dispatcher cannot be found.
- struts2 The Struts dispatcher cannot be found异常解决办法
- struts2标签 The Struts dispatcher cannot be found
- Struts2错误:The Struts dispatcher cannot be found.
- struts标签错误The Struts dispatcher cannot be found.
- The Struts dispatcher cannot be found in struts2
- struts2错误:The Struts dispatcher cannot be found.
- The Struts dispatcher cannot be found. 使用struts标签时该报错的解决方案
- struts2报错The Struts dispatcher cannot be found
- struts2错误:The Struts dispatcher cannot be found.
- struts标签错误The Struts dispatcher cannot be found.
- struts2错误:The Struts dispatcher cannot be found.
- Struts2-The Struts dispatcher cannot be found
- org.apache.jasper.JasperException: The Struts dispatcher cannot be found的解决方法
- struts2的“The file cannot be validated as the host "struts.apache.org" is currently unreachable"问题解决