关于struct国际化的问题出现如下错误:
1.The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Strut
2.s tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher n
3.eeded for this tag. - [unknown location]
解决:
web.xml 中添加一个filter
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/action/*</url-pattern>
</filter-mapping>
2.s tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher n
3.eeded for this tag. - [unknown location]
解决:
web.xml 中添加一个filter
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/action/*</url-pattern>
</filter-mapping>
最后就可以运行了
本文介绍了Struts2框架中遇到的国际化问题及解决方案。当使用Struts2标签时出现Struts2分发器未找到的错误,通常是因为缺少必要的过滤器配置。文中详细解释了解决该问题的方法,即在web.xml中正确配置Struts2过滤器。
278

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



