AJAX part is here:
Enclose your contents in 3 separate divs.
Now, call reloadReqdForm() function, instead of submitting the page.
something.do is the name of Action you are using.
Now, whatever will be the result it will come as req.responseText in the last function, which u will put in message var.
div1 is the e name/id of the div that u want to reload.
function reloadReqdForm(){
var url = "something.do?queryString";
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.open("POST", url, true);
req.onreadystatechange = callbackReloadForm;
req.send(null);
}
function callbackReloadForm()
{
if (req.readyState == 4)
{
if (req.status == 200) {
drawResponse();
}
}
}
function drawResponse() {
var message = req.responseText;
document.getElementById("div1").innerHTML=message;
}
Hope, it will work.