com.sun.grizzly.http.webxml
Class WebappLoader
java.lang.Object
com.sun.grizzly.http.webxml.WebappLoader
public class WebappLoader
- extends Object
This class allow you to load a web.xml into a WebApp object. WebappLoader support web-app 2.2, 2.3, 2.4, 2.5 and 3.0.
WebappLoader will load the right Parser and populate the info from the web.xml. WebApp class is a generic WebApp object,
that doesn't depends on the web.xml version.
To load a web.xml is simple.
WebApp webapp = webappLoader.load("./target/classes/samples/web-2.2.xml");
You can check the content of the WebApp object with webapp.toString()
. The output will be in xml.
- Author:
- Sebastien Dionne
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected static Logger logger
- Default Logger.
WEB_APP_DEFAULT
public static final String WEB_APP_DEFAULT
- See Also:
- Constant Field Values
WEB_APP_2_2
public static final String WEB_APP_2_2
- See Also:
- Constant Field Values
WEB_APP_2_3
public static final String WEB_APP_2_3
- See Also:
- Constant Field Values
WEB_APP_2_4
public static final String WEB_APP_2_4
- See Also:
- Constant Field Values
WEB_APP_2_5
public static final String WEB_APP_2_5
- See Also:
- Constant Field Values
WEB_APP_3_0
public static final String WEB_APP_3_0
- See Also:
- Constant Field Values
WebappLoader
public WebappLoader()
getDefaultVersion
public String getDefaultVersion()
- Returns:
- the default parser version
getAvailableVersion
public static Collection<String> getAvailableVersion()
- Returns:
- list of the webapp version supported
setDefaultVersion
public void setDefaultVersion(String version)
throws Exception
- Parameters:
version
- web.xml parser that will be used
- Throws:
Exception
- if the version is not found, Use the Constants.
load
public static WebApp load(String webxml)
throws Exception
- Parameters:
webxml
- the web.xml file that will be loaded
- Returns:
- the WebApp loaded
- Throws:
Exception
- any exceptions will be thrown here if there is a problem parsing the file
extractWebXmlInfo
public static WebApp extractWebXmlInfo(String schemaVersion,
String webxml)
throws Exception
- Parameters:
schemaVersion
- webxml
-
- Returns:
- WebApp populated from the web.xml file
- Throws:
Exception
Copyright © 2012 Oracle Corporation. All Rights Reserved.