cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@infoplanning.com>
Subject Re: CocoonServlet.java 1.1.4.12
Date Fri, 14 Jul 2000 12:07:53 GMT
Stuart Roebuck wrote:
> 
> Correcting my previous email, the problem is that getServletPath() is
> returning a zero length string, which causes an exception on
> "uri.charAt(0)".
> 
> Perhaps:
> 
>         String uri=req.getServletPath();
>         if (uri!=null) try {
>             if (uri.charAt(0)=='/') uri=uri.substring(1);
> 
> Should be:
> 
>         String uri=req.getServletPath();
>         if (uri != null && uri.length() > 0) try {
>             if (uri.charAt(0)=='/') {
>                 if (uri.length() > 1) uri=uri.substring(1);
>                 else uri="";
>             }
> 
> However, that takes away the exception but leaves me with other problems!
> 

What is the expected result of getPathInfo?  Any time a servlet is mapped
to '/', it needs to use the getServletPath.  Another approach is to use the
getRequestURI method.

Mime
View raw message