Store the core itself in the servlet context.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 18 Apr 2012 21:41:10 +0000 (23:41 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 18 Apr 2012 21:41:10 +0000 (23:41 +0200)
src/main/java/net/pterodactylus/demoscenemusic/core/Core.java

index bfa8dee..4dc36f4 100644 (file)
@@ -45,6 +45,7 @@ public class Core implements ServletContextListener {
         * {@inheritDoc}
         */
        public void contextInitialized(ServletContextEvent servletContextEvent) {
+               servletContextEvent.getServletContext().setAttribute("core", this);
                try {
                        Context context = new InitialContext();
                        DataSource dataSource = (DataSource) context.lookup("java:/comp/env/jdbc/demosceneMusic");