Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting html frames to jsp includes

 
balajik Kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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%>" />
</frameset>
<frame name="footer" src="footer.jsp" />
</frameset>

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).
Code:

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

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
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic