Results 1 to 2 of 2

Thread: Refreshing applicationContext on the fly

  1. #1
    Join Date
    Apr 2008
    Posts
    9

    Default Refreshing applicationContext on the fly

    I am looking for some ideas on how to refresh my applicationContext with out restarting the application by invoking following line of code.
    ((XMLWebApplicationContext)applicationContext).ref resh();

    I have few approaches in mind to achieve this, please comment on them

    1) Have a button on the webpage during development phase click on it to invoke a servlet which would retrieve applicationContext by some means(from a bean that implements ApplicationContextAware/ get from servletContext attribute) and then refresh it

    2) I am not sure if this would work, I want to access the applicationContext from a class outside the web application. is there a way to access ServletContext from a class not with in the web application. Like can i go to where my application is installed through the filesystem and run a class which accesses ServletContext or applicationcontext directly. If i can do that i could write an ant task or maven goal to run that program to refresh my applicationContext on the fly with out having to restart the app.


    Thanks in advance

  2. #2
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    314

    Default

    I think someone posted some ideas how to refresh the application context a while ago in this forum.
    if a trainstation is where the train stops, what's a workstation...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •