Hi, guys:
I just start to use
Servlet and now I met a problem when I tried to call a method in my servlet. Could anybody give me some suggestions to solve this problem?
Here is what I am doing:
1. I have a form, <form name="inputform" action="PerformWebTestServlet" onsubmit="loadingPage()" method="post">
2. In the doPost(reqs, reps) method of the PerformWebActionServlet, I new another class and try to invoke a method of this class to get some result. Please see:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession session = request.getSession(true);
DataBean dataBean = (DataBean) session.getAttribute("dataBean");
... ...
SingleTestWebImpl runner= new SingleTestWebImpl();
try {
runner.doWork(dataBean .getMppigName, dataBean.getVerifyxmlName, dataBean.getTestcasename(), "false", dataBean.getLogfile());
} catch (InvalidMappingException e) { }
RequestDispatcher requestDispatcher = request.getRequestDispatcher("SemanticTestResult.jsp");
requestDispatcher.forward(request, response);
}
3. My problem is the runner.doWork(). This method involves some database querying work. if it can be finished in a short time, everything is fine. It can go to the SemanticTestResult.jsp and shows the result. However, if the runner.doWork() needs a little longer time, for example 15+ seconds. The IE will show "This program cannot display the webpage" Please see the attached pic. And also I found the method runner.doWork() is sitll able to successfully finished in the console and at this time, if you input the right url of SemanticTestResult.jsp at IE, I am still able to see the right result.
I feel this is probably a connection timeout problem. But I just do not know how to solve this problem. I mean when the servlet runs the longer runner.doWork(), how can I let IE connection alway alive and wait for result?
Thank you so much.