|
-
Jul 5th, 2008, 04:06 AM
#1
Thread Starter
Hyperactive Member
dynamically change page content
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)
Code:
<%-- 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,
Please go to the Thread Tools menu and click Mark Thread Resolved when your post is answered 
If someone helped you today then please consider rating their post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|