This is my jsp page where i want to simply retrieve a string from responseText and display using ajax.... but it does not work help needed
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function GetXmlHttpObject()
{var xmlHttp=null;
try
{ // Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}catch (e)
{ //Internet Explorer
try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e)
{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} }return xmlHttp;
}

function search(){

xmlHttp=GetXmlHttpObject();
var url="getname.jsp";
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange = updatepage;

xmlHttp.send(null);
}

function updatepage(){
if(xmlHttp.readyState==4 && xmlHttp.status == 200)
{


var showdata = xmlHttp.responseText;

if(showdata){
document.getElementById("uname").value=showdata
document.getElementById("uname").value=showdata

}
}
}

</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>




</head>

<body bgcolor="white">
<form name="f1" method="post">
<table>
<tr>
<td>User Name</td><td><input type="text" id="uname" name="username"></td>
</tr>
<td>Password</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="b1" value="LogIn" on="search();"></td>
</tr>
</table>

<input type="text" id="e" name = "abs" value="">
</form>
</body>
</html>



The jsp from where the string is returned
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>

<%

out.println("Hello");





%>