Hello Cindy:
Synchronize the method, is not good idea if you have a lot of operations inside.
You can use a UserBean to make the work, an make an instance inside the Servlet method, and you get a thread safing method (doGet or doPost).
This is an example code:
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response){
MyBean instanceBean = new MyBean();
instanceBean.userMethod();
}
}
public class MyBean {
userMethod(){
//make the work
}
}
This is thread safing!!!
Greetings
