Jetty
  1. Jetty
  2. JETTY-849

WebAppContext should support configuration from web.xml / descriptors from streams.

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      WebAppContext and the supporting WebXmlConfiguration currently only accept the web.xml / descriptor location as a String, which is used as a systemId to construct an org.xml.sax.InputSource. This does not support using web.xml / descriptors from resources not available as a local file, etc.

      For example, for unit testing, I'd like to dynamically build various web.xml files in-memory, then pass these in to the WebXmlConfiguration. Currently, it appears my only workaround is to write this to a temporary file, then pass in the path of the temporary file.

      Accepting an InputStream is probably the best way to support alternate input sources. An InputStream can easily be obtained from a String, a resource on the classpath, or practically any other resource. org.mortbay.xml.XmlParser already has a .parse(InputStream) method to support this.

        Activity

          People

          • Assignee:
            Jan Bartel
            Reporter:
            Mark Ziesemer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: