/
Module API
Module API
Definition
API to manipulate J2EE archives, including vendor-specific deployment descriptors
Explanation
This API is located in the org.codehaus.cargo.module
package and is used internally by the Cargo Java API. You can also use it yourself if you need to manipulate (read/write) J2EE archive files.
It also supports merging two web.xml
files into one.
See the Javadoc for more details on the API.
Architecture
![]() |
Descriptors
|
Example
File warFile = new File("/path/to/simple.war"); WarArchive war = new DefaultWarArchive(warFile); // Verify existence of class inside the WAR assertTrue(war.containsClass("test.Test")); // Verify version of the Servlet specifications used in web.xml WebXml webXml = war.getWebXml(); assertEquals(WebXmlVersion.V2_3, webXml.getVersion()); // Add a context-param element in web.xml Element contextParamElement = createContextParamElement(doc, "param", "value"); webXml.addContextParam(contextParamElement); assertTrue(webXml.hasContextParam("param")); [...]
, multiple selections available,
Related content
Deploying legacy WARs to Tomcat 10.x onwards
Deploying legacy WARs to Tomcat 10.x onwards
More like this
Adding a Samples Test
Adding a Samples Test
More like this
Merging WAR files
Merging WAR files
More like this
Maven 3 Archetypes
Maven 3 Archetypes
More like this
Static deployment of WAR
Static deployment of WAR
More like this
Static deployment of expanded WAR
Static deployment of expanded WAR
More like this