You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Pål Wester <pa...@never.no> on 2001/05/21 17:43:21 UTC

cocoon 1.8.2 not working on IPlanet 4.1 because

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





Re: cocoon 1.8.2 not working on IPlanet 4.1 because

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 21 May 2001, [iso-8859-1] P�l Wester wrote:

> 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:

patched, thanks. please send patches against the cvs version though.

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org