Assuming that you want to download this HashMap for only one web application, you can do this when the container loads all the settings of your application (after reading the file web.xml). To do this, you can create a class that implements ServletContextListener.
contextInitialized HashMap ServletContext. - ServletContext, /jsp, .
:
class ContextListenerImpl implements ServletContextListener {
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext sc = sce.getServletContext();
sc.setAttribute("mySpecialMap", map);
}
}
,
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
Map<Your,Types> map = (Map<Your,Types>) getServletContext()
.getAttribute("mySpecialMap");
}
, : -.
<listener>
<listener-class>full.name.of.ContextListenerImpl</listener-class>
</listener>
web.xml .