tags:

views:

285

answers:

1

I have a servlet which takes us to an existing jsp, say "home.jsp". This is composed of many jspf fragments. So struture is like

Home.jsp includes jsp1, jsp2 and so forth.

Now we have part of modules migrated to struts2 and have a "new.jsp" (uses struts2 tags) which we need to include inside "home.jsp". To achieve this I have placed

<s:action namespace="/home" name="showNewJsp" executeResult="true"/>

which returns the "new.jsp" as result.

but when I hit the sevlet , during rendering I get exception about the struts 2 FilterDispatcher. The exception trail is attached.

Please clarify if (1) Is this possible to render a S2 jsp while not rendering it via S2 action

                **(2)** any thing is missing ?

The following is the exception trace :

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)
A: 

ok, It was not possible to use the struts 2 tags directly, but I got a work around.

We can use <iframes> to divide the sections which are S2 based. Providing a S2 url inside the iframe works and the view can be rendered in conjunction with the non S2 based jsp.

Nrj