Jetty XmlConfiguration

Mort Bay Consulting Jetty XmlConfiguration.
O'Reill OnJava.com article
Kudos to the Jetty team for taking the XML configuration one step farther: ... all Jetty-specific calls
... are element or attribute values, not names. This means the XML configuration can be used with any classes, even
non-Jetty classes. Depending on how your app is written, you could configure it all through Jetty's XML config.

See the references below for more details.


try {
final XmlConfiguration xconfig = new XmlConfiguration(<configUrl>);
xconfig.configure(<object ref>);
} catch (IOException ioe) {
...
} catch (SAXException saxe) {
...
} catch (Exception e) {
...
}

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC
"-//Mort Bay Consulting//DTD Configure 1.1//EN"
"http://jetty.mortbay.org/configure_1_2.dtd">
<Configure class="java.util.Map">
<!-- add a class object to the Map -->
<Call name="put">
<Arg>
<New class="java.lang.String">
<Arg>some key text String</Arg>
</New>
</Arg>
<Arg>
<Call class="java.lang.Class" name="forName">
<Arg>java.lang.String</Arg>
</Call>
</Arg>
</Call>
</Configure>

Comments

Popular posts from this blog

Sites, Newsletters, and Blogs

Oracle JDBC ReadTimeout QueryTimeout