I make static classes in servlet, these classes are controllers for web pages. Requests are redirected to controllers by controller urls that are in static HashMap that contains all controllers. Are there any posibilities that user/session realted stuff could get messsed up with other users sessions? I will of course save all session related data to HttpSession and request, response and HttpSession objects are given to controller when controller request handler is called.
UPDATE:
Here is example:
public class MainControllerServlet extends HttpServlet {
static HashMap<String, ControllerAbstract> controllers = new HashMap<String, ControllerAbstract>();
public MainControllerServlet()
{
controllers.put("url", new Controller());
}
}
ControllerAbstract:
public abstract class ControllerAbstract {
private String url;
private HashMap<String, ControllerAbstract> children = new HashMap<String, ControllerAbstract>();
public abstract void handleRequest(HttpServletRequest request, HttpServletResponse response, SessionBean session, String type) throws Exception;
}