HttpServletRequest request, HttpServletResponse response)
throws Exception {
try
{
while(true)
{
//in order to test the socket weather is connected,
//when the IOexception happened, let the while quit, determinate the loop.
//don't change this code,otherwise i will kick your ass!!
//bard 2012-01-06
response.flushBuffer();
PrintWriter out=response.getWriter();
out.print("<script>" +
"alert('bard ok');" +
"</script>");
out.flush();
Thread.sleep(3000);
}
}catch (IOException e)
{
System.out.println("client is disconneted!");
}
return null;
}
我采用的是struts1.3。