cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@mortbay.com>
Subject Re: News from the Websphere 5.0 front
Date Mon, 03 Feb 2003 16:19:56 GMT

Peir - don't get me started on the stupidity of the servlet specs path mapping!

I was aware if the difference between the spec and Jetty - but I had not
changed it as:

  + I am loath to change something that has been that way for a long time.

  + I was waiting to fail a watchdog test in order to force me to do it and
    have a good reason if users complained.

  + I was hoping the spec would correct itself.

  + I have also noticed that some code in tomcat (eg default servlet) has been
    written so that it will support either approach - hence I had thought
    they were getting ready to change?

But I guess they are all just lame excuses...  so it is probably time to change
or at least add optional behaviour.

Do you need this urgently or can you work around it for now?


regards


Pier Fumagalli wrote:> "Christian Haul" <haul@dvs1.informatik.tu-darmstadt.de> wrote:
> 
>>On 03.Feb.2003 -- 02:18 PM, Pier Fumagalli wrote:
>>
>>>"Christian Haul" <haul@dvs1.informatik.tu-darmstadt.de> wrote:
>>>
>>>
>>>>On 03.Feb.2003 -- 01:55 PM, Pier Fumagalli wrote:
>>>>
>>>>>"Gernot Koller" <grizzly@gmx.at> wrote:
>>>>>
>>>>>> <map:match pattern="documents/index">
>>>>>>    <map:redirect-to uri="{request:contextPath}/documents/index.html"/>
>>>>>>
>>>>>>seems to fix most of these problems.
>>>>>>Still it's probably not the most elegant solution, is it ?
>>>>>
>>>>>Nope... But Jetty had the same problem... It's not a problem within Cocoon,
>>>>>it's a problem within WebSphere. In Jetty we patched it (in CVS right
now).
>>>>
>>>>Speaking of jetty: In jetty request.getServletPath() returns an empty
>>>>string. Is that a bug or a feature?
>>>
>>>It is (IMO) the correct interpretation of the specification. If a servlet is
>>>mapped to all, as Cocoon does, then also ("/") is part of the path info, and
>>>therefore getServletPath (in my opinion) should be empty...
>>>
>>>What does Tomcat do? Does it return "/" or ""????
>>
>>Depends on where you evaluate it. See the 2.1 samples. I use
>>getServletPath() to find the paths involved after the context path to
>>locate the source files. It works well in tomcat but does not in
>>jetty.
>>
>>Thus jetty  http://localhost:8888/samples/foo/bar gives ""
>>and  tomcat http://localhost:8080/cocoon/samples/foo/bar gives "samples/foo"
> 
> 
> The spec is (IMO) stupid in that, as it defines in page 76 that the
> behaviour of "/" as an "exceptional" case to be treated with care...
> 
> I verified it, and actually Jetty doesn't do what page 76 of the servlet
> spec says in regards to the default ("/" mapped) servlet, it behaves as a
> person with some intelligence should...
> 
> I just verified that both Tomcat and ServletExec correctly interpret the
> specification and map stuff as the exception on page 76 mentions...
> 
> I'm CCing Greg Wilkins on that as he might be aware of a trick to make it
> work, or maybe he can help us fix the engine, and get the next version of
> Jetty even "better" (more compliant to an becoming-idioticly-complex
> specification) :-) :-)
> 
> Greg, you aware of this or should I try to get a patch working for it? I
> know you're very busy, and I seriously don't mind putting some hours in it.
> Just tell me if I should.
> 
> The problem is that if I map a servlet to "/" ServletExec and I request the
> "/the/servlet/spec/is/stupid" and Tomcat both return
> "/the/servlet/spec/is/stupid" as getServletPath() and null as getPathInfo(),
> while Jetty returns "" to getServletPath() and "/the/servlet/spec/is/stupid"
> in getPathInfo()...
> 
>     Pier




-- 
Greg Wilkins<gregw@mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com


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


Mime
View raw message