cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r365645 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal: pluto/om/ServletDefinitionListImpl.java util/PortalUtils.java
Date Tue, 03 Jan 2006 14:50:12 GMT
Author: cziegeler
Date: Tue Jan  3 06:50:08 2006
New Revision: 365645

URL: http://svn.apache.org/viewcvs?rev=365645&view=rev
Log:
Fix bug in web.xml checking and start adding util code for valid ids.

Added:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java   (with
props)
Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java?rev=365645&r1=365644&r2=365645&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/om/ServletDefinitionListImpl.java
Tue Jan  3 06:50:08 2006
@@ -99,10 +99,9 @@
 
             servletMap.put(servlet.getServletName(), servlet);
             ServletMapping servletMapping = (ServletMapping)mappings.get(servlet.getServletName());
-            if ( servletMapping == null) {
-                 throw new ProcessingException("No corresponding servlet mapping found for
servlet name '"+servlet.getServletName()+"'");
+            if ( servletMapping != null) {
+                ((Support)servlet).postBuild(servletMapping);
             }
-            ((Support)servlet).postBuild(servletMapping);
         }
     }
 

Added: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java?rev=365645&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java (added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java Tue Jan
 3 06:50:08 2006
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.util;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Some utility methods.
+ *
+ * @version $Id$
+ */
+public class PortalUtils {
+
+    public static String testId(String id) {
+        if ( !StringUtils.containsOnly(id, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789
") ) {
+            return "Id contains invalid characters (only a-z,A-Z,0-9, space and '-' are allowed):
" + id;
+        }
+        return null;
+    }
+
+}

Propchange: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/PortalUtils.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message