The same threading issues apply to any Servlet based software. This is because the Servlet container creates an instance of the Servlet and then invokes certain methods such as doGet() using multiple threads (each thread servicing a different HTTP request).
So there are many threading issues and you must be careful! In general don't re-use your model just as you suggested. However some types of data can take advantage of this singleton approach - for example data that you may want to set once but will remain the same for the life-time of the servlet such as a list of countries on a contact form. In this case you can do something like:
The following could be in a SimpleFormController for example:
Code:
private List countryList;
protected Map referenceData(HttpServletRequest request) {
Map model = new HashMap();
if (countryList == null) {
// only get the countries the first time this Controller is used
countryList = middleware.getAvailableCountries();
}
model.put("countryList", countryList);
}
The countries may then be displayed in a drop-down list in your form for each use of the form, but the hit of generating the list only happens once.
Java Servlet Programming from O'reilly is a good source of material regarding Servlet threading issues.
Hope that helps.