On 4/17/07, Sanjiv Jivan <[EMAIL PROTECTED]> wrote:
ah, I knew I was missing something :) However does it make sense for the context refresh() call to be in the ServletListener instead of directly in the ReloadController? With the call to refresh() in the StartupListener, the context will unnecessarily be refreshed on startup.
Yes, that probably does make better sense. Currently, the StartupListener's setupContext() method is a good place to initialize site-wide drop-downs, but probably not for refreshing the ApplicationContext - unless there was a way to detect initial startup. Of course, checking for drop-down lists in the ServletContext might be a good way of checking for this. Matt
Sanjiv On 4/17/07, Matt Raible <[EMAIL PROTECTED]> wrote: > > StartupListener has a method that is called by the ReloadController. > > Matt > > On 4/17/07, Sanjiv Jivan <[EMAIL PROTECTED]> wrote: > > I understand that part, but why is the call the refresh() in the servlet > > listener (which is called only once on application startup) and not in some > > controller that gets called when, say, the user clicks on a button. > > > > Sanjiv > > > > > > On 4/17/07, j2ee dodo < [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > To reload all Spring config files without restarting the server at runtime > > > ==> Save time during development > > > > > > > > > > > > Sam > > > > > > > > > ----- Original Message ----- > > > From: Sanjiv Jivan > > > To: [email protected] > > > Sent: Tuesday, April 17, 2007 11:10 AM > > > Subject: Re: [appfuse-user] spring 2.0.4 FrameworkServlet.refresh() > > > > > > Maybe I'm missing something here, but why is the call to refresh() in the > > StartupListener? > > > > > > > > > On 4/16/07, j2ee dodo < [EMAIL PROTECTED]> wrote: > > > > 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] > > > > > > > > > > > > > > > > > > > > > -- > http://raibledesigns.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
-- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
