Commit 20eb8c48 authored by Dave Cridland's avatar Dave Cridland

Merge pull request #487 from guusdk/OF-1025

OF-1025: Restore web-custom.xml functionality
parents f77c0399 770fee82
...@@ -155,7 +155,7 @@ public class PluginServlet extends HttpServlet { ...@@ -155,7 +155,7 @@ public class PluginServlet extends HttpServlet {
} }
Document doc = saxReader.read(webXML); Document doc = saxReader.read(webXML);
// Find all <servlet> entries to discover name to class mapping. // Find all <servlet> entries to discover name to class mapping.
List classes = doc.selectNodes("//servlet"); List classes = doc.getRootElement().elements("servlet");
Map<String, Class> classMap = new HashMap<>(); Map<String, Class> classMap = new HashMap<>();
for (int i = 0; i < classes.size(); i++) { for (int i = 0; i < classes.size(); i++) {
Element servletElement = (Element)classes.get(i); Element servletElement = (Element)classes.get(i);
...@@ -164,7 +164,7 @@ public class PluginServlet extends HttpServlet { ...@@ -164,7 +164,7 @@ public class PluginServlet extends HttpServlet {
classMap.put(name, manager.loadClass(plugin, className)); classMap.put(name, manager.loadClass(plugin, className));
} }
// Find all <servelt-mapping> entries to discover name to URL mapping. // Find all <servelt-mapping> entries to discover name to URL mapping.
List names = doc.selectNodes("//servlet-mapping"); List names = doc.getRootElement().elements("servlet-mapping");
for (int i = 0; i < names.size(); i++) { for (int i = 0; i < names.size(); i++) {
Element nameElement = (Element)names.get(i); Element nameElement = (Element)names.get(i);
String name = nameElement.element("servlet-name").getTextTrim(); String name = nameElement.element("servlet-name").getTextTrim();
...@@ -211,8 +211,8 @@ public class PluginServlet extends HttpServlet { ...@@ -211,8 +211,8 @@ public class PluginServlet extends HttpServlet {
saxReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", saxReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",
false); false);
Document doc = saxReader.read(webXML); Document doc = saxReader.read(webXML);
// Find all <servelt-mapping> entries to discover name to URL mapping. // Find all <servlet-mapping> entries to discover name to URL mapping.
List names = doc.selectNodes("//servlet-mapping"); List names = doc.getRootElement().elements("servlet-mapping");
for (int i = 0; i < names.size(); i++) { for (int i = 0; i < names.size(); i++) {
Element nameElement = (Element)names.get(i); Element nameElement = (Element)names.get(i);
String url = nameElement.element("url-pattern").getTextTrim(); String url = nameElement.element("url-pattern").getTextTrim();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment