Hello Pals,I have a
JSP called JSPLeft.jsp which has 5 buttons
on it and it's included on every page using <jsp:include > tag.
Now, because each including(Parent)JSP has it's unique form name
as in <Form name="formName" action="Controller"> .The form name is used within a Javascript function ,which is invoked on clicking any button on these JSPs.
This function assigns a value(The Destination page of the button)
to the hidden field which is checked in the dispatcher within the
controller servlet.So,i have this statement in my Function for each button:
document.formName.hiddenFieldName.value="DestinationPage.jsp";
Question:
The problem is how can i include the same JSPLeft.jsp on all my JSP pages since these Parent(including) JSPs have their own uniques names and a Form can only have a name .The Script below appears in all pages included on a Parent page.
<SCRIPT language="Javascript">
function setDestinationPage(varName)
{
switch(varName)
{
case 'buttonOne':
document.formName.hiddenFieldName.value="DestinationPage1.jsp";
break;
case 'buttonTwo':
document.formName.hiddenFieldName.value="DestinationPage2.jsp";
break;
..................................................
}
}
</SCRIPT>
Please all ideas are welcomed.Cheers.