Announcement Announcement Module
Collapse
No announcement yet.
Spring MVC 3.1 load controllers dynamically Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Some OSGI stuff could help. Maybe with dm Server?

    Comment


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

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            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.

            Comment

            Working...
            X