How to call struts action from jsp: include or tiles?

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

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

+4
source share
1 answer

If I understand your problem correctly. In your main JSP, you want to include content that is the result of another action. I'm not sure about jsp: include or tiles, but you can do this using

  • To do this, you first need to add your action to the global forwards, for example, name="beanIncFwd" path="/beanIncludeTest.do"
  • Add an action form corresponding to the ActionForm (for example, name="beanIncForm" )
  • add the action definition to the action tag (for example, I use the direct forward, you can use your own class here) path="/beanIncAction" and forward="/mypage.jsp"
  • Add the required classes (e.g. Action and ActionForm)
  • In your main JSP, write the following where you want to include content

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

+3
source

Source: https://habr.com/ru/post/1391972/


All Articles