About Question enthuware.jwpv6.2.580 :
Posted: Thu Jan 10, 2013 2:04 pm
the doubt is related to what is written in the specs. acc to the specs
Dispatching from a synchronous servlet to an asynchronous servlet would be illegal. However the decision of throwing an IllegalStateException is differed to the point when the application calls startAsync. This would allow a servlet to either function as a synchronous or an asynchronous servlet."
Therefore, in the given situation where the target servlet processes each request asynchronously, an IllegalStateException will be thrown.
if dispatching from synchronous servlets to asynchronous servlet will throw IllegalStateException when startAsync() is called then why the spec says "THIS WOULD ALLOW A SERVLET TO EITHER FUNCITON AS A SYNCHRONOUS OR AN ASYNCHRONOUS SERVLET". i think this is logically incorrect.
Dispatching from a synchronous servlet to an asynchronous servlet would be illegal. However the decision of throwing an IllegalStateException is differed to the point when the application calls startAsync. This would allow a servlet to either function as a synchronous or an asynchronous servlet."
Therefore, in the given situation where the target servlet processes each request asynchronously, an IllegalStateException will be thrown.
if dispatching from synchronous servlets to asynchronous servlet will throw IllegalStateException when startAsync() is called then why the spec says "THIS WOULD ALLOW A SERVLET TO EITHER FUNCITON AS A SYNCHRONOUS OR AN ASYNCHRONOUS SERVLET". i think this is logically incorrect.