Hi gang,

spring 2.0.4 FrameworkServlet.refresh() is supposedly able to refresh Spring config
files at runtime(correct me if wrong), so I  did something like below in
StartupListener.setupContext(...)


public static void setupContext(ServletContext context) {
       ApplicationContext ctx =
           WebApplicationContextUtils.getRequiredWebApplicationContext(context);

       LookupManager mgr = (LookupManager) ctx.getBean("lookupManager");

       // get list of possible roles
       context.setAttribute(Constants.AVAILABLE_ROLES, mgr.getAllRoles());

       if (log.isDebugEnabled()) {
           log.debug("Drop-down initialization complete [OK]");
       }

       // code taken from FrameworkServlet.refresh() of Spring 2.0.4
       if (!(ctx instanceof ConfigurableApplicationContext)) {
throw new IllegalStateException("WebApplicationContext does not support refresh: " + ctx);
       }
       ((ConfigurableApplicationContext) ctx).refresh();

         log.warn("Refresh Spring config files complete.");
         System.out.println("Refresh Spring config files complete.");

   }

change Spring config files, then login to call reload from menu, yet it doesn't seem to work

Did anyone get it to work???

Thanks,

Sam


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to