Skip to content Skip to sidebar Skip to footer

Struts 2 Load A Page In Div

i have an image of my home page and i am wondering if it is posssible in struts2 to load all other pages such as products services facilities etc. in the red div in the middle of

Solution 1:

You also can use struts2 tiles for your problem. Create your base layout using tiles. your layout is similar to the layout in this tutorial. So all you need is to have your menu in header part of layout. On click of button or menu youy call a particular action whic inturn call a particular tile definition which will have your concerned jsp page in the middle :)

Solution 2:

If I understand you correct then It may be a solution.

Create all your contents that you want to display in a div tag of other page. In a different page Call that JSP in that div using following tag

  <%@ include file="yourPage.jsp"%> 

Links of those menus create them in yourPage.jsp use above Tag wherever you want to include this page.

This solution is not from Struts2 if you want in struts2 refer this Struts2 Tile Tutorial

Create Whatever the stuff that you want in that red color div create as a seperate JSP file and include that JSP File

for example

  Your main jsp page--- 
      main.jsp

         <body>
               <div id="someDiv">
                </div>
                <div id="yourredDiv">
                    //here you include that jSP page.
                         <%@ include file="path/yourPage.jsp"%> 
                 </div>
            </body>
        Now in yourpage.jsp

              you create the html components whatever you want.

Post a Comment for "Struts 2 Load A Page In Div"