【发布时间】:2013-09-06 06:03:41
【问题描述】:
我有一个现有的普通 jsp Web 应用程序。 根据客户要求,我需要创建一些带有下拉选择框的配置页面。我必须在 Struts 2 中创建这个页面。 我已经创建了一个 struts 页面,但我无法从我现有的应用程序中调用这个 struts2 页面。
我遇到了错误。
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]
at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)
at jsp_servlet.__addprevdn._jsp__tag0(__addprevdn.java:112)
at jsp_servlet.__addprevdn._jspService(__addprevdn.java:84)
Truncated. see log file for complete stacktrace
【问题讨论】:
-
你不能那样做,如果你绕过 Struts2 过滤器,框架还没有准备好为你和标签提供服务,这也违反了 MVC。请弄清楚如何使用struts2