On to the Servlets Application , i know that there is only one Servlet created , which perofrms all requests for the Actions
If we have a DTO Object which we use for Setting the Data inside the Servlet , for example
public class Servlet extends HttpServlet
{
public void doGet()
{
EmployeeDTO edto = new EmployeeDTO();
edto.setName("Test");
}
}
Now if there are 100 reuests , how many DTO objects created here ??
100 of course. You don’t want to share request-specific data between individual endusers, do you?
On a related note, it may be helpful to read this to learn more about how exactly servlets work behind the scenes: How do servlets work? Instantiation, sessions, shared variables and multithreading.