* @throws JDOMException if the deployment descriptor cannot be parsed correctly
*/
protected Document getWebXml() throws JDOMException, IOException
{
URL url;
SAXBuilder builder = new SAXBuilder();
builder.setValidation( false );
builder.setEntityResolver( new LocalEntityResolver() );
Document doc = null;
if ( m_engine.getServletContext() == null )
{
ClassLoader cl = WebContainerAuthorizer.class.getClassLoader();
url = cl.getResource( "WEB-INF/web.xml" );
if( url != null )
log.info( "Examining " + url.toExternalForm() );
}
else
{
url = m_engine.getServletContext().getResource( "/WEB-INF/web.xml" );
if( url != null )
log.info( "Examining " + url.toExternalForm() );
}
if( url == null )
throw new IOException("Unable to find web.xml for processing.");
log.debug( "Processing web.xml at " + url.toExternalForm() );
doc = builder.build( url );
return doc;
}