2011-02-04 67 views
0
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) 

什麼原因導致這種情況,我該如何解決?Struts錯誤:無法找到Struts調度程序

回答

2

堆棧跟蹤似乎證實了異常消息解釋的內容:您可能嘗試呈現login.jsp頁面,並且此JSP使用一些struts標記。但由於請求還沒有經過Struts過濾器,所以標籤無法工作。在Struts(以及其他基於動作的框架AFAIK)中,每個URL(除靜態資源,如圖像,腳本等)都應該指向cebtral servlet或過濾器,這些servlet或過濾器分派給您的操作,該操作本身轉發給一個JSP。如果直接調用JSP,它不再是MVC,並且標記無法工作。