I have tried sending the value as shown(code), but no value is being caught in JSP.
It is showing null value in jsp page.
this is javascript/ajax code
It is showing null value in jsp page.
this is javascript/ajax code
Code:
var emp = document.getElementById("Employee").value;
var url_temp = "print_emp.jsp?Employee="+emp;
alert(url_temp);
var xmlhttp;
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("result_display").innerHTML=xmlhttp.responseText;
//document.getElementById(result_display).innerHTML="print_emp.jsp";
}
}
xmlhttp.open("GET",url_temp,true);
xmlhttp.send();
trying to read in jsp page as shown below, but no use.
String employee=request.getParameter("emp");
System.out.println("this is employee value"+employee);
Comment