3

I have jsp, in which I want to include another jsp which is the forwarded result of struts action.

How I can include/insert using jsp:include/tiles insert or any other method? Any help would be appreciated.

1 Answers1

1

If I understood your problem correctly. In your main JSP, You want to include a content which is a result of another action. I am not sure about jsp:include or tiles, but you can do this by using

  1. For that first you have to add your action to global forwards like
    name="beanIncFwd" path="/beanIncludeTest.do"
  2. Add action form corresponding ActionForm (for example name="beanIncForm")
  3. add the definition of action in action tag (for example I am using direct forward; you can use your own class here) path="/beanIncAction" and forward="/mypage.jsp"
  4. Add the required classes (i.e. Action and ActionForm)
  5. In your main JSP, write the following at the location where you want the included contents

    bean:include id="includePart" forward="beanIncFwd"/>
    bean:write name="includePart" filter="false"/>

Naved
  • 4,020
  • 4
  • 31
  • 45