//jsppage<scripttype="text/javascript">varreq;varwhich;functionretrieveURL(url)...{if(window.XMLHttpRequest)...{//Non-IEbrowsersreq=newXMLHttpRequest();req.onreadystatechange=processStateChange;try...{req.open("GET",url,true);}catch(e)...{alert(e);}req.send(null);}elseif(window.ActiveXObject)...{//IEreq=newActiveXObject("Microsoft.XMLHTTP");if(req)...{req.onreadystatechange=processStateChange;req.open("GET",url,true);req.send();}}}functionprocessStateChange()...{if(req.readyState==4)...{//Completeif(req.status==200)...{//OKresponsedocument.getElementById("txtText").value=req.responseText;}else...{alert("Problem:"+req.statusText);}}}</script><body><bean:messagekey="title.key"/><html:formaction="/index"method="post"><inputtype="button"value="ok"onclick="retrieveURL('/demohi/index.do?status=tn')"/><inputtype="text"id="txtText"/></html:form></body>//ActionpublicActionForwardexecute(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse)...{IndexFormf1=(IndexForm)form;if(request.getParameter("status").equals("tn"))...{try...{response.setContentType("text/html");PrintWriterout=response.getWriter();out.print("thisisatestajax");out.flush();}catch(Exceptionme)...{}}}