0

I have a section which gets displayed using the struts tag below followed by a jsp include

<div>
     <span>Title</span>
    <s:action name="content" namespace="/tempcontent" executeResult="true" flush="false">
        <s:param name="shortName">qr</s:param>
        <s:param name="maxResults">3</s:param>
        <s:param name="template">/jsp/peps/chSection.jsp</s:param>
    </s:action>
</div>

<div>
   <%@include file="/jsp/ratings/includes/screening.jsp" %>
</div>

Here I am not able to render the JSP using the include directive. If I remove the section containing struts tag It gets included properly. This seems to be strange to me. Please help.

Vivek
  • 137
  • 2
  • 17
  • *This seems to be strange to me.* Me too, but I don't have the same problem because I don't use s:action tag. – Roman C Mar 26 '14 at 14:47

2 Answers2

0

I am not able to render the JSP

Have you included the Struts tags declaration ?

<%@ taglib prefix="s" uri="/struts-tags" %>

Also remember the big differences between a static <%@include directive, a dynamic <jsp:include/> action, or even better, use a Struts-specific <s:include /> tag.

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
  • I did include the Struts tags declaration. I have also tried with all the above include statements. This is really odd. Does the view from struts action super seeding the existing JSP content. It should not. The view from struts action is a sort of include only. – Vivek Mar 26 '14 at 15:00
0

I have solved that with the help of Velocity.I have used velocity template for the view. Now its able to include the other JSPs in it.

<div>
 <span>Title</span>
<s:action name="content" namespace="/tempcontent" executeResult="true" flush="false">
    <s:param name="shortName">qr</s:param>
    <s:param name="maxResults">3</s:param>
    <s:param name="velTemplate">chPepSection.vm</s:param>
    <s:param name="template">/jsp/peps/chSection.jsp</s:param>
</s:action>
</div>

<div>
   <%@include file="/jsp/ratings/includes/screening.jsp" %>
</div>

I am using velocityEngine to merge the model i am getting for the view with the velocity template.

Vivek
  • 137
  • 2
  • 17