Read web.xml with one line of code Part 2
I did a previous post about how to do it with XMLBean or JABX, but it was more an example how to do it. This time is the real deal.
I used JABX to generate the java classes from the schemas and use that to parse the web.xml.
The result is a simple class : WebAppLoader that will load the web.xml.
Here a example :
WebappLoader webappLoader = new WebappLoader();
WebApp webapp = webappLoader.load("/web-2.2.xml");
The object WebApp contains all the infos extracted from the web.xml. The representation is based on webapp 3.0.
you can get the source code from my repository : http://kenai.com/projects/sebastiendionne/sources/repository/show/dtd-schemas-generator
- Login or register to post comments
- Printer-friendly version
- survivant's blog
- 1019 reads






Comments
by survivant - 2009-03-25 10:31
yep. It's the power of JABX :) but we don't use it in the same context.by felipegaucho - 2009-03-25 10:24
it is like my smallest atom http://weblogs.java.net/blog/felipegaucho/archive/2008/12/the_smallest_a...