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.
这通常是由于不经由Filter访问包含struts标签的jsp页面导致的。那么,只要通过配置,使得对jsp页面的访问请求由Filter过滤转发即可。
这个导致的原因有几个:
1.配置struts2基础出错,这个一般很少,例如导包少了,路径配错等。
2.这个一般是主要原因:
在服务器端过滤器某段代码使用了重定向有struts标签的jsp页面的代码
导致struts2自带过滤器没有被经过。
所以解决方法
1.去掉jsp页面struts标签
2.改重定向路径新页面,再用人工action去跳转目标jsp,是个笨办法,但不失为一个办法
本文探讨了Struts2框架中使用标签时遇到的问题,通常由于未通过Filter访问包含struts标签的jsp页面而引起。文章分析了可能的原因,包括配置错误和重定向路径不当,并提供了相应的解决方案。
185

被折叠的 条评论
为什么被折叠?



