1

I am using the iframe and created four frames in homePage.jsp like this...

<body>
        <iframe name="headerContent" src="pages/header.jsp"  class="headerStyle" scrolling=no frameborder=0 marginwidth=0 marginheight=0></iframe>
        <iframe name="menuContent"   src="pages/menu.jsp"    class="menuStyle" scrolling=no frameborder=0 marginwidth=0 marginheight=0></iframe>
        <iframe name="menuContent2"  src="pages/content.jsp" class="contentStyle" scrolling=no frameborder=0 marginwidth=0 marginheight=0></iframe>
        <iframe name="footerContent" src="pages/footer.jsp"  class="footerStyle" scrolling=no frameborder=0 marginwidth=0 marginheight=0></iframe>
</body>

and have a menu.jsp which contains 4 links and when i click on one link and in href tag i am calling the action(which is defined in struts.xml) and this action is calling a class which is returning some data and on the SUCCESS it is forwarding to a CUSTOMERMAIN.jsp file but beacuse of iframe it is not displaying any jsp file.

If i don't use the iframe ..it is working fine and displaying the jsps properly....

Roman C
  • 49,761
  • 33
  • 66
  • 176

1 Answers1

1
  1. Your iframes should call Action classes, not JSP directly, because that's how an MVC framework, and Struts2 in particular, works;
  2. You are reinventing the wheel, what you are trying to do is an ugly version of TILES.

Read more on:

Struts with Tiles Example

Hot to integrate Struts2 with Tiles3

Tiles 3 Plugin (since the doc is a work in progress, read Tiles 2 Plugin)

Community
  • 1
  • 1
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243