Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-57

ServletToolboxManager fails for .war files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3
    • VelocityView
    • None
    • irrelevant

    Description

      When webapps are deployed as .war files and the ServletToolboxManager is loaded from a shared location (mine is in shared/lib on Tomcat), the getInstance(ServletContext,String) method always returns the same manager. This is because the call to ServletContext.getRealPath(String) method, whose return value is used as the key into the managersMap, returns null when the webapp is deployed as a jar, per the servlet API. So, all ServletContext's end up getting/putting their managers using the null key into the managersMap .

      This is easy to fix. You just need another way to scope the toolbox filename based on the input ServletContext that's guaranteed to return something unique.

      Attachments

        1. patch
          0.8 kB
          Justin Patterson

        Activity

          People

            nbubna Nathan Bubna
            justinp Justin Patterson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: