• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Converting html frames to jsp includes

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was trying to re-factor my application by converting html frames to jsp includes. The code sample for html frames is as follows

<frameset rows="97,*,40">
<frame name="header" src="header.jsp" />
<frameset cols="250,*">
<frame name="menu" src="sidemenu.jsp" />
<frame name="Content" src="<%=url%>" />
<frame name="footer" src="footer.jsp" />

my side menu.jsp is put in a frameset which is divided into two parts(menu,content) and the menu part has several hyper links. So when i ever i click on hyper link, page gets loaded into second part(content) and my side menu remains in the first half. In this case only the second half gets reloaded for very click on the side link or any part of the content.

Now we need to remove the frames concept and i was trying with table layout(which i would later move to css implementation).

<table border="1" cellpadding="2" cellspacing="2" align="left">
<td height="97" colspan="2" width="1000"><jsp:include page="header.jsp" /></td>
<td height="250" width="250"><jsp:include page="sidemenu.jsp" /></td>
<td><jsp:include page="<%=url%> /></td>
<td height="40" colspan="2"><jsp:include page="footer.jsp" /></td>

In this case, when i ever i click on hyper link of menu it gets loaded in a separate tab rather than in second <td>(content) of the table, this is because my menu and content are not in a separate frame. I am really struggling here, i want to get the data which i get from the hyper link into second column of second row with out the whole page getting refreshed.

With frames whatever changes that i do in the content page gets refreshed in content page only, i wanted to achieve the same using some other means(jsp include/tiles). can you please guide me
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jsp:include is not dynamic in the way that frames are. It is only for 'including' content, once and only once; the very first time it is served to the browser along with the rest of the page.

You can use frame again in that area only. The rest seem to be static areas which dont need frames at all.

Another way is by using ajax. You will retrieve data using ajax, and then load that content into the div (where the frame used to be). It can be done using xml, or json-formatted data from the server. Jquery can help in this ajax communication.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic