Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sitemesh (composite views)  RSS feed

 
Manjesh Patil
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am using Sitemesh component to get composite view for one of my J2ee based application.

The problem is javascript function defn like function a() {} and the caller <body onload=a()/> of individual pages are not being copied to the final/resultant page.
It is copying the <body > tag of layout.jsp when this happens my onload functtion call and functions are missing,,

layout.jsp

<html>
<head>
<title>Your Company Name</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
</style>
<link rel="stylesheet" href="css/styles.css" type="text/css">
</head>
<body BGCOLOR="8BB381" text="#000000" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0" link="#eeeeee" align="center">
<jsp:include page="/includes/header.jsp"></jsp:include>
<table width="75%" cellspacing="0" cellpadding="0" border="0"
align="center" bgcolor="#C5908E" height="150%">
<tr height="30">
<td height="250" valign="top" width="160">
<table width="160" cellspacing="0" cellpadding="8" border="0"
height="150">
<tr >
<td class="menu">
<jsp:include page="/includes/navigation.jsp"></jsp:include>
</td>
</tr>

</table>

</td>
<td bgcolor="#f0ddc8" height="250" valign="top" >
<decorator:body />
</td>

</tr>
</table>
<jsp:include page="/includes/footer.jsp"></jsp:include>
</body>
</html>


one of individual page
abc.jsp

<html>
<title>create you profile</title>

<head>
<script type="text/javascript">
function toggleHopitalInfo(){
alert("toggling info");

}
</script>
</head>
<body onload="toggleHopitalInfo()">
<form method="post">
.
.
</form>
</body>
</html>


thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!