Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-126

Reload Java Classes for Improved Developer Experience

    XMLWordPrintableJSON

Details

    Description

      Currently in Wicket it is possible to reload the templates in DEVELOPMENT mode, but it is not possible to reload Java classes. That makes it very painful for the developer, as a server restart is required every time. One can still use hot code replace within the debugger, but that is not reliable and does not work every time, especially when the method signatures change.

      The attached experimental patch addresses that issue by providing a custom classloader and an adaptation of WicketFilter to allow reloading the Wicket application upon a class file change. As soon as a Java class is updated in the classes directories, the corresponding application is reloaded by WicketFilter. Also, bookmarkable pages are properly reloaded.

      On the TODO list:

      • allow to switch off class reloading
      • allow to specify the location of directories containing class files
      • porting to WicketServlet
      • more testing

      I wanted to share this code ASAP for you to test. It is based on branch 1.x.

      Note that part of the code comes from Apache Cocoon, released under the Apache license.

      Attachments

        1. 20061129-wicket-1.x-ReloadingClassLoader
          13 kB
          Jean-Baptiste Quenot
        2. 20061130-wicket-1.x-ReloadingClassLoader
          16 kB
          Jean-Baptiste Quenot
        3. 20061130-wicket-1.x-ReloadingClassLoader
          17 kB
          Jean-Baptiste Quenot
        4. 20061201-wicket-1.x-ReloadingClassLoader
          18 kB
          Jean-Baptiste Quenot
        5. WICKET-126-1.x.patch
          20 kB
          Eelco Hillenius
        6. WICKET-126-trunk.patch
          19 kB
          Eelco Hillenius
        7. 20061203-wicket-1.x-ReloadingClassLoader-includes
          17 kB
          Jean-Baptiste Quenot
        8. 20061203-wicket-1.x-ReloadingClassLoader-includes
          16 kB
          Jean-Baptiste Quenot
        9. 20061205-wicket-1.x-ReloadingClassLoader
          2 kB
          Jean-Baptiste Quenot
        10. 20070114-wicket-1.x-ReloadingWicketFilter
          1 kB
          Jean-Baptiste Quenot
        11. 20070114-wicket-1.x-ReloadingWicketFilter
          1 kB
          Jean-Baptiste Quenot
        12. 20070114-wicket-1.x-ReloadingWicketFilter
          1 kB
          Jean-Baptiste Quenot
        13. 20070114-wicket-1.x-ReloadingWicketFilter
          3 kB
          Jean-Baptiste Quenot

        Activity

          People

            jbq Jean-Baptiste Quenot
            jbq Jean-Baptiste Quenot
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: