[jboss-cvs] JBossAS SVN: r62138 - in trunk/server/src/main/org/jboss/metadata: web and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 5 12:50:46 EDT 2007


Author: remy.maucherat at jboss.com
Date: 2007-04-05 12:50:45 -0400 (Thu, 05 Apr 2007)
New Revision: 62138

Modified:
   trunk/server/src/main/org/jboss/metadata/WebMetaData.java
   trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java
Log:
- Adapt from Tomcat 3 additional checks for TCK negative deployment tests.

Modified: trunk/server/src/main/org/jboss/metadata/WebMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2007-04-05 16:07:01 UTC (rev 62137)
+++ trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2007-04-05 16:50:45 UTC (rev 62138)
@@ -108,6 +108,10 @@
    protected List<String> dependencies = new ArrayList<String>();
    protected ReplicationConfig replicationConfig;
    protected PassivationConfig passivationConfig;
+   
+   private boolean gotJspConfig = false;
+   private boolean gotLoginConfig = false;
+   private boolean gotSessionConfig = false;
 
    /** web.xml env-entrys */
    private ArrayList<EnvEntryMetaData> environmentEntries = new ArrayList<EnvEntryMetaData>();
@@ -220,6 +224,33 @@
    /** The ClassLoader to load additional resources */
    private URLClassLoader resourceCl;
 
+   public void gotJspConfig()
+   {
+      if (gotJspConfig)
+      {
+         throw new IllegalStateException("<jsp-config> element is limited to 1 occurance");
+      }
+      gotJspConfig = true;
+   }
+   
+   public void gotLoginConfig()
+   {
+      if (gotLoginConfig)
+      {
+         throw new IllegalStateException("<login-config> element is limited to 1 occurance");
+      }
+      gotLoginConfig = true;
+   }
+   
+   public void gotSessionConfig()
+   {
+      if (gotSessionConfig)
+      {
+         throw new IllegalStateException("<session-config> element is limited to 1 occurance");
+      }
+      gotSessionConfig = true;
+   }
+   
    public String getDescription()
    {
       return description;

Modified: trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java	2007-04-05 16:07:01 UTC (rev 62137)
+++ trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java	2007-04-05 16:50:45 UTC (rev 62138)
@@ -130,6 +130,7 @@
       }
       else if (localName.equals("session-config"))
       {
+         dd.gotSessionConfig();
          child = new SessionConfig();
       }
       else if (localName.equals("error-page"))
@@ -146,6 +147,7 @@
       }
       else if (localName.equals("login-config"))
       {
+         dd.gotLoginConfig();
          child = new LoginConfig();
       }
       else if (localName.equals("message-destination"))
@@ -170,6 +172,7 @@
       }
       else if (localName.equals("jsp-config"))
       {
+         dd.gotJspConfig();
          child = dd;
       }
       else if (localName.equals("jsp-property-group"))




More information about the jboss-cvs-commits mailing list