Results 1 to 6 of 6

Thread: Spring MVC 3.1 load controllers dynamically

  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Default Spring MVC 3.1 load controllers dynamically

    I am using Spring MVC 3.1 for my web project and I have a particular use case. I have to allow users to drop a jar file which has @Controller for RequestMapping that needs to be loaded dynamically. In other words, I do not have an option to restart the Tomcat or the Context (War). How can I do this.

  2. #2
    Join Date
    Mar 2007
    Posts
    561

    Default

    Some OSGI stuff could help. Maybe with dm Server?

  3. #3
    Join Date
    Jul 2012
    Posts
    3

    Default

    We are using Tomcat and other servers is not an option.

  4. #4
    Join Date
    Mar 2007
    Posts
    561

    Default

    You could try to reload just some smaller spring applicationContexts bu I bet this will not work with @Controller since this is bound to the servlet context.
    Why no servlet context restart?

    Maybe an own handler for MVC-annotations will help.

  5. #5
    Join Date
    Jul 2012
    Posts
    3

    Default

    Servlet Context restart is not possible because there could be users actively working in the system. Its just that new functionality
    can be added on the fly. This is requirement in stone. Do you have any examples of "own handler for MVC-annotations" or how to approach this.

  6. #6
    Join Date
    Mar 2007
    Posts
    561

    Default

    DefaultAnnotationHandlerMapping maybe a good start.
    But, I think you will have no luck... all that stuff is not designed in a way to reload parts of a webapp. It may work somehow some day, but you will get new problems (mem leaks, stale dependencies etc pp).

    Just reload the app, make the reload FAST and persist sessions.

Tags for this Thread

Posting Permissions

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