Greyskull
Jul 5th, 2008, 04:06 AM
Hello,
Im starting to learn a few things with JSP and here is my current situation:
I have several jsp pages linked together namely: header, menu, content and footer.
Each item in the menu should be associated with a different content i.e menu1content.jsp, menu2content.jsp, etc...
I have created an ant files to build and compile the jsp pages to a .war file and run it using Tomcat.
The question is, how would i do it so that whenever a link is clicked on the menu, the content of the page dynamically changes. i.e when link 1 is clicked it automatically assigns menu1content.jsp to the page?
Here is my main layout (baselayout.jsp)
<%-- Include common set of tag library declarations for each layout --%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<html>
<head>
<title>
<tiles:getAsString name="title" ignore="true"/>
</title>
</head>
<body>
<div align="center">
<table width="80%%" border="0" cellpadding="5">
<tr>
<td colspan="2">
<tiles:insert attribute="header"/>
<hr />
</td>
</tr>
<tr>
<td rowspan="2" width="20%">
<tiles:insert attribute='menu' ignore="true"/>
</td>
<td width="80%"><tiles:insert attribute='content' ignore="true"/></td>
</tr>
<tr>
<td width="80%">
<hr />
<tiles:insert attribute="footer"/>
</td>
</tr>
</table>
</div>
</body>
</html>
im not sure whether ive explained this right but any help is gr8ly appreciated
Thanks,
Im starting to learn a few things with JSP and here is my current situation:
I have several jsp pages linked together namely: header, menu, content and footer.
Each item in the menu should be associated with a different content i.e menu1content.jsp, menu2content.jsp, etc...
I have created an ant files to build and compile the jsp pages to a .war file and run it using Tomcat.
The question is, how would i do it so that whenever a link is clicked on the menu, the content of the page dynamically changes. i.e when link 1 is clicked it automatically assigns menu1content.jsp to the page?
Here is my main layout (baselayout.jsp)
<%-- Include common set of tag library declarations for each layout --%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<html>
<head>
<title>
<tiles:getAsString name="title" ignore="true"/>
</title>
</head>
<body>
<div align="center">
<table width="80%%" border="0" cellpadding="5">
<tr>
<td colspan="2">
<tiles:insert attribute="header"/>
<hr />
</td>
</tr>
<tr>
<td rowspan="2" width="20%">
<tiles:insert attribute='menu' ignore="true"/>
</td>
<td width="80%"><tiles:insert attribute='content' ignore="true"/></td>
</tr>
<tr>
<td width="80%">
<hr />
<tiles:insert attribute="footer"/>
</td>
</tr>
</table>
</div>
</body>
</html>
im not sure whether ive explained this right but any help is gr8ly appreciated
Thanks,