[Seaside] [BUG][FIX]PWS seaside cannot handle plain url

Nevin Pratt nevin@smalltalkpro.com
Thu, 25 Apr 2002 21:09:31 -0600


Julian Fitzell wrote:

>> Another probably useful change is to check the url and to add 'seaside'
>> if it is empty. This then also lets the previous code add 'config' and
>> you get to a useful place.
>>
>> I really dislike websites that go nowhere with a plain url.
>
>
> I agree... but I can't quite see how we can enforce this from the 
> seaside end.  It's fair to say that we're taking /seaside but I'm not 
> sure I'm comfortable just blindly throwing ourselves in as the default 
> handler.  (IAKom also goes nowhere if you don't give it a path).
>
> There are so many ways a web server could be set up and laid out... 
> can we make an assumption that will work?  Perhaps we could check if 
> there is already something linked to "default" and if not, then add 
> ourselves?
>
> Julian
>
>
>

I'm using Comanche rather than PWS, but my solution is that if 'seaside' 
is not already in the URL, then Seaside never gets invoked, and Comanche 
just handles it.  This allows Comanche to handle normal URL's as if 
Seaside wasn't present.  This also means that Comanche handles the empty 
URL case, and Seaside never sees it.

Then, if the URL is truly empty, I look for an 'index.html' file, 
followed by an 'index.htm' search, in that order.  If either file is 
found, it is appended to the URL, and that is used for the empty URL 
case.  That's more in line with what Apache does.

Furthermore, I removed the 'config' append code, making it so that all 
invocations of the Seaside 'config' app have to be deliberate.  I would 
rather people didn't "accidentally" stumble on the config page, even 
though it's password protected.

All of these changes are in my own "IAKom" class, which I have called 
"IAComancheInterface".  I would have subclassed IAKom to do this, but at 
the time IAKom only had one method (the #process: method), and it seemed 
silly to subclass and then override the only method.  So, I didn't subclass.

Nevin