how handle when client send multiple request at atime for
single servlet

Answers were Sorted based on User's Feedback



how handle when client send multiple request at atime for single servlet..

Answer / abdul hameed

Servlets is Dynamically Loaded into the memory only once
then It is handeled by Thread, for each Client there will
be a Thread, and Service method will be called for each
Request, so its meaningles that a client is sending a
single request or multiple request

Is This Answer Correct ?    29 Yes 3 No

how handle when client send multiple request at atime for single servlet..

Answer / sunil kumar yadav

As Servlets are multithreaded by default , so whenever any
client request comes to any servlet immediatly that servlet
instance create one indepndent thread to handle that
request.And like that it handles 100's of request, But
after one time instace if client request goes very high
then container creats another instance for the same servlet
to handle more requests

Is This Answer Correct ?    16 Yes 1 No

how handle when client send multiple request at atime for single servlet..

Answer / suryaprakash

well i agree with u all
but i found a problem in my application
i created web based chat application

when any of the two clients enter to hit the servlet at the
same time
it is skipping one request
and within the two requests it will process only one of the
request

Is This Answer Correct ?    2 Yes 1 No

how handle when client send multiple request at atime for single servlet..

Answer / srinivasa

By making a servlet Thread safe object we can achieve .For
this servlet needs to implement singlethreadmodel interface

Is This Answer Correct ?    5 Yes 8 No

how handle when client send multiple request at atime for single servlet..

Answer / srinivas from inetsolv

By declaring printwriter objetct as an local variabel to the
service method.Doing like this every thread will hava a
seperate copy of printwriter object on its stack
space.Hence there is no problem for even though when we
have multiple requests for at a time for same servlet.

Is This Answer Correct ?    10 Yes 14 No

Post New Answer

More Struts Interview Questions

What are the core components of a struct2 based application?

0 Answers  


What are the sections into which a strut configuration file can be divided?

0 Answers  


If the framework doesn’t do what I want, can I request that a feature be added?

0 Answers  


What are best practices to follow while developing Struts2 application?

0 Answers  


What is Request Dispatcher and What is reuest Processor??

2 Answers  






What is actionform in struts?

0 Answers  


I will explain the scenario now i have a form1 having some fields and i made it extends DynaActionForm. in struts config how can i specify another form form2 which has to extend the form1 please specify is it better to use actionform or dyna action form in applations. is dyna action form is comfortable in declaring form variables of type 'ArrayList<somegenerics>' extend the

0 Answers   Techno Solutions,


What is struts framework in java?

0 Answers  


Which technologies can be used at view layer in struts?

0 Answers  


what are the componenets of struts?

8 Answers   HCL,


How can we work with error tags?

0 Answers  


How you will enable front-end validation based on the xml in validation.xml?

0 Answers  


Categories