【发布时间】:2010-02-03 07:34:54
【问题描述】:
我有一个 servlet,它将我们带到一个现有的 jsp,比如“home.jsp”。这是由许多jspf片段组成的。所以结构就像
Home.jsp 包括 jsp1、jsp2 等。
现在我们已经将部分模块迁移到 struts2 并有一个“new.jsp”(使用 struts2 标记),我们需要将其包含在“home.jsp”中。 为了实现这一点,我已经放置了
<s:action namespace="/home" name="showNewJsp" executeResult="true"/>
返回“new.jsp”作为结果。
但是当我点击 sevlet 时,在渲染过程中我得到了关于 struts 2 FilterDispatcher 的异常。附上异常线索。
请说明(1)是否可以在不通过 S2 操作渲染的情况下渲染 S2 jsp
**(2)** any thing is missing ?
以下是异常跟踪:
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 org.apache.jsp.matterhome_jsp._jspx_meth_s_005faction_005f0(matterhome_jsp.java:5021)
at org.apache.jsp.matterhome_jsp._jspService(matterhome_jsp.java:1339)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
【问题讨论】: