cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pål Wester <pal.wes...@never.no>
Subject cocoon 1.8.2 not working on IPlanet 4.1 because
Date Mon, 21 May 2001 15:43:21 GMT
the damn server sends null as values to some headers that crashes
in XSLTProcessor.java. the name is validated, but the value isn't so the
result is a nullpointer......

I don't know if the fault is on the Netscape side or not, but I think
the problem is solved for me with this patch:

this is a diff from the XSLTProcessor from cocoon 1.8.2
diff -u XSLTProcessor.java.old XSLTProcessor.java
--- XSLTProcessor.java.old      Fri Jan 26 19:17:25 2001
+++ XSLTProcessor.java  Mon May 21 11:29:21 2001
@@ -127,8 +127,8 @@
         if (parameters != null) {
             while (parameters.hasMoreElements()) {
                 String name = (String) parameters.nextElement();
-                if (isValidName (name))
-                    params.put (name, request.getParameter (name));
+                if (isValidName (name))//PCW
+                    params.put(name, (request.getParameter(name)==null ? ""
: request.getParameter(name) ) );
             }
         }

@@ -146,8 +146,8 @@
         if (headers != null) {
           while (headers.hasMoreElements ()) {
             String name = (String) headers.nextElement ();
-            if (isValidName (name))
-              params.put ("R_" + name, request.getHeader (name));
+            if (isValidName (name)) //PCW
+              params.put ("R_" + name, ( request.getHeader (name)==null ?
"" : request.getHeader (name) ) );
           }
         }

@@ -155,6 +155,11 @@
     }

     private boolean isValidName (String name) {
+//PCW
+                               if( name==null)
+                                       return false;
+//PCW
+
                                StringCharacterIterator iter = new
StringCharacterIterator(name);
                                boolean valid_name = true;
                                char c = iter.first();

any comments??
mvh: Pål Wester
høgskoleingenør/programmerer


never.no as, stortingsgt 30, 0161 Oslo
direkte: 22 01 66 34, 906 900 62
tlf: 22 01 66 34, fax: 22 01 66 21
http://never.no - icq:103476059





Mime
View raw message