I'm using AJAX to get refreshed values from database server.
After I get the response from the server then if it has new values then I want to reload the entire page. But I'm receiving null pointer errors? any help? urgent!!
below is the code.

script language="javascript">
if (window.XMLHttpRequest) {
      requester = new XMLHttpRequest();
} else if (window.ActiveXObject) {
     requester = new ActiveXObject("Microsoft.XMLHTTP");
    }
</script>

<script language="javascript">
var t = window.setInterval('getDataFromServer()', 30*1000);

function getDataFromServer(){
var url = "<%= request.getContextPath() %>/RefreshServlet"
requester.open("GET", url);
requester.send(null);
requester.onreadystatechange = stateHandler;
}


function stateHandler(){
if (requester.readyState == 4) {
   var x= requester.responseText;
   if (x>0){
var x = alert("New WEPA Request is submitted.");
  
var url="<%= request.getContextPath() % /QRefreshServlet"
   requester.open("GET", url);
requester.send(null);
requester.onreadystatechange = stateHandler1;
  
 }
return true;
}
}