About AbstractAsynServlet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sreenath_reddy
Posted On:   Friday, July 6, 2007 06:37 AM

Hi , I am learning AbstractAsyncServlet. In doRequest method I have one un ended loop. When I send the request to this servlet it is not calling doTimeOut method. It is not coming out of the loop even the specified time is over. My Servlet: public class AsynServlet extends AbstractAsyncServlet { PrintWriter pw; protected boolean doRequest(RequestResponseKey rrk) throws IOException, ServletException { pw = rrk.getResponse().getWriter(); pw.write("in doRequest"); while(true){ if(2==20) break; } pw.write("in doRequest1"); return true; } prot   More>>

Hi ,
I am learning AbstractAsyncServlet.
In doRequest method I have one un ended loop.
When I send the request to this servlet it is not calling doTimeOut method. It is not coming out of the loop even the specified time is over.
My Servlet:


public class AsynServlet extends AbstractAsyncServlet {


PrintWriter pw;


protected boolean doRequest(RequestResponseKey rrk) throws IOException, ServletException {

pw = rrk.getResponse().getWriter();

pw.write("in doRequest");

while(true){

if(2==20)

break;
}
pw.write("in doRequest1");

return true;

}


protected void doResponse(RequestResponseKey arg0, Object arg1) throws IOException, ServletException {

pw.write("in doResponse");


}

protected void doTimeout(RequestResponseKey rrk) throws IOException, ServletException {

pw.write("In do time out");

}

public void init() throws ServletException {

super.init();

this.setTimeout(10);

}



}


Help in this out?

   <<Less

Re: About AbstractAsynServlet

Posted By:   WarnerJan_Veldhuis  
Posted On:   Friday, July 6, 2007 06:42 AM

well this is never going to happen now, is it?? if(2==20)
About | Sitemap | Contact