While Ajax is a great suggestion, I can understand why you would want to avoid Ajax at this time. I don't think that the experts here know how much time it takes to learn a whole new concept/language...I mean, they already know how to use it so it seems quite simple to them. You should take the time to learn Ajax though, it's very cool stuff that is easy to use once you understand it... but to understand it you have to have a firm understanding of JavaScript and client-server interactions which takes a while to learn.
So instead I'm going to recommend that you try using an iframe.
In this recommendation you don't actually use the <jsp:include> to include the xyz.jsp page into your page.
An iframe lets you show more than one page on the same page.
The iframe is another
"window" within the page so make sure that you understand how these work before attempting to use it....
It will let you have the xyz.jsp page on the same page as your main.jsp page, however anything within the iframe will only submit to the xyz.jsp page.
Your main page would look something like:
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head id="Head1" runat="server">
-
<title>Some page</title>
-
</head>
-
<body>
-
<form id="mainForm"action="MainPage.jsp" method="post" name="mainForm">
-
<!-- .... Main Page Content ... -->
-
<iframe id="xyziframe src="xyz.jsp"></iframe>
-
<!-- ... More Main Page Content ... -->
-
</form>
-
</body>
-
Or, you could have 2 <form>s on the same page but you have to be careful that they are not inside one another.
Using my second idea involves your main page looking like:
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head id="Head1" runat="server">
-
<title>Some page</title>
-
</head>
-
<body>
-
<form id="mainForm"action="MainPage.jsp" method="post" name="mainForm">
-
<!-- .... Main Page Content ... -->
-
</form>
-
<form id="xyzForm"action="xyz.jsp" method="post" name="xyzForm">
-
<!-- .... XYZ Page Content ... -->
-
</form>
-
</body>
-
This would mean that your xyz.jsp page would only print out <form>...content...</form> and wouldn't be a full page (by full page I mean includes the <html></html> tag)
Hope this helps
-Frinny