logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Url's: msg#00112

Subject: Re: Url's

On Oct 26, 2005, at 3:47 PM, Avi Bryant wrote:

This should work:

WADispatcher default basePath: '/'

Though, of course, that exhibits the problem Ramon pointed out.  So I think the better solution is to use this patch:

handlerForRequest: aRequest relativeTo: base
      | path name |
       path := aRequest url.
       (base isEmpty or: [path beginsWith: base])
               ifTrue: [| relativePath |
                       relativePath := path allButFirst: base size.
                       (relativePath notEmpty
                                       and: [relativePath first = $/])
                               ifTrue: [name := (relativePath findTokens: '/')
                                                               at: 1
                                                               ifAbsent: []].
                       entryPoints
                               at: name
                               ifPresent: [:n | ^ n]].
       ^ WANotFoundHandler new

And then 

WADispatcher default basePath: ''

The root problem here, I think, is that

'foo' beginsWith: ''

returns false, which is not the semantics I would expect.  

Avi
_______________________________________________
Seaside mailing list
Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>