// Create hash model wrapper for servlet context (the application). We need one thread, once per servlet context
synchronized (servletContext) {
ServletContextHashModel servletContextModel = (ServletContextHashModel) servletContext.getAttribute(ATTR_APPLICATION_MODEL);
if (servletContextModel == null) {
// first try a JSP support servlet. If it fails, default to the servlet.
GenericServlet servlet = JspSupportServlet.jspSupportServlet;
if (servlet != null) {
servletContextModel = new ServletContextHashModel(servlet, wrapper);
servletContext.setAttribute(ATTR_APPLICATION_MODEL, servletContextModel);
} else {
servletContextModel = new ServletContextHashModel(servletContext, wrapper);