gpt4 book ai didi

java - 支柱错误: The Struts dispatcher cannot be found

转载 作者:行者123 更新时间:2023-12-02 08:24:03 26 4
gpt4 key购买 nike

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.__login._jsp__tag0(__login.java:115)
at jsp_servlet.__login._jspService(__login.java:84)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3495)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

是什么原因导致此问题以及如何解决它?

最佳答案

堆栈跟踪似乎证实了异常消息所解释的内容:您可能尝试呈现login.jsp 页面,并且此JSP 使用一些struts 标记。但由于请求没有经过 Struts 过滤器,因此该标签无法工作。

在 Struts(以及所有其他基于操作的框架 AFAIK)中,每个 URL(除了图像、脚本等静态资源)都应该指向 cebtral servlet 或过滤器,它分派(dispatch)到您的操作,而操作本身又转发到JSP。如果直接调用JSP,它就不再是MVC,标签也无法工作。

关于java - 支柱错误: The Struts dispatcher cannot be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4897018/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com