This is my jsp file
<%@ 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>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Heelo;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script>
$(function() {
console.log('something');
$.getJSON('test', function(data) {
console.log(data);
});
});
</script>
</body>
</html>
And this is my servlet file
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
try {
Thread.sleep(360000);
} catch (InterruptedException e) {
e.printStackTrace();
}
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException e) {
e.printStackTrace();
}
out.write("[]");
}
This is a request sent to a servlet. But if this servlet takes a long time (for example, 6 minutes) to process, there is no data printed to console. In the example above, I can see 'something' printed to console, but no '[]'.
But if I do a curl
to that servlet directly, I can get the result back.
Any help?