User: starksm
Date: 02/04/04 00:26:20
Modified: src/main/org/jboss/metadata Tag: Branch_2_4 WebMetaData.java
Log:
Add support for setting the context-root of a standalone war and support
for setting the virtual host of the war.
Revision Changes Path
No revision
No revision
1.2.6.3 +42 -6 jboss/src/main/org/jboss/metadata/WebMetaData.java
Index: WebMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/metadata/WebMetaData.java,v
retrieving revision 1.2.6.2
retrieving revision 1.2.6.3
diff -u -r1.2.6.2 -r1.2.6.3
--- WebMetaData.java 12 Nov 2001 19:32:56 -0000 1.2.6.2
+++ WebMetaData.java 4 Apr 2002 08:26:20 -0000 1.2.6.3
@@ -22,7 +22,7 @@
* @see org.jboss.web.AbstractWebContainer
* @author [EMAIL PROTECTED]
- * @version $Revision: 1.2.6.2 $
+ * @version $Revision: 1.2.6.3 $
*/
public class WebMetaData implements XmlLoadable
{
@@ -32,11 +32,17 @@
private HashMap ejbReferences = new HashMap();
private ArrayList securityRoleReferences = new ArrayList();
private String securityDomain;
-
+ /** The war context root as specified as the jboss-web.xml
+ descriptor level. */
+ private String contextRoot;
+ /** The server container virtual host the war should be deployed into
+ */
+ private String virtualHost;
+
public WebMetaData()
{
}
-
+
/** Return an iterator of the env-entry mappings.
@return Iterator of EnvEntryMetaData objects.
*/
@@ -76,7 +82,27 @@
{
return securityDomain;
}
-
+
+ /** This the the jboss-web.xml descriptor context-root and it
+ *is only meaningful if a war is deployed outside of an ear.
+ */
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+ public void setContextRoot(String contextRoot)
+ {
+ this.contextRoot = contextRoot;
+ }
+
+ /** The servlet container virtual host the war should be deployed into. If
+ null then the servlet container default host should be used.
+ */
+ public String getVirtualHost()
+ {
+ return virtualHost;
+ }
+
public void importXml(Element element) throws Exception
{
String rootTag = element.getOwnerDocument().getDocumentElement().getTagName();
@@ -139,11 +165,21 @@
*/
protected void importJBossWebXml(Element jbossWeb) throws Exception
{
- // Parse the jboss-web/securityDomain element
+ // Parse the jboss-web/context-root element
+ Element contextRootElement = MetaData.getOptionalChild(jbossWeb,
"context-root");
+ if( contextRootElement != null )
+ contextRoot = MetaData.getElementContent(contextRootElement);
+
+ // Parse the jboss-web/security-domain element
Element securityDomainElement = MetaData.getOptionalChild(jbossWeb,
"security-domain");
if( securityDomainElement != null )
securityDomain = MetaData.getElementContent(securityDomainElement);
-
+
+ // Parse the jboss-web/virtual-host element
+ Element virtualHostElement = MetaData.getOptionalChild(jbossWeb,
"virtual-host");
+ if( virtualHostElement != null )
+ virtualHost = MetaData.getElementContent(virtualHostElement);
+
// Parse the jboss-web/resource-ref elements
Iterator iterator = MetaData.getChildrenByTagName(jbossWeb, "resource-ref");
while( iterator.hasNext() )
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development