If an exact match cannot be determined, should an exception be thrown (fail-fast?), or should some other behavior be implemented -- such as selecting the default sub-application? (I keep wanting to say defaulting to ... and that just gets to be a tongue-twister!)
I'm going to implement this. I view it (as do many others) as a bug - think someone even filed on it. I'd love some "expert direction" on this certain behavior though. Oh - you'll get a diff -u once it's done :-) Of that you can rest assured. Thanks! Eddie Bush wrote: > Why do we even need to lookup the prefix? That seems error-prone, at > best. Yeah, ok, maybe we should check to be sure that what we arrive > at for a prefix is valid, and ... throw an exception if it isn't. I > think we should select the application differently. What I would like > to do is: > > - get the index of "/" (beyond the first one) > - if it's not there, this is the default sub-application > - if it's there, get the substring from the initial "/" - up > to, but excluding, the final "/" > - lookup this substring in the prefix array (exact match) > - if it is present, we choose that sub-application > - if it is not present, we assume the default > sub-application or throw an exception > > This way, we always default to the ... default ... sub-application. > So, if someone had a "/" in the querystring (for whatever reason), we > would fail to find a match with our declared prefixes. The default > sub-application would be selected. Say we manage to get a match - > that sub-application would be selected. Also, we have just (greatly) > increased the namespace for possible sub-applications - compared to > what it is right now. > > How does that sound? If I should throw an exception, rather than > default to the ... I don't like saying default for the sub-app name > ... rather than selecting the default sub-app, what would it be? An > unavailable exception wouldn't be appropriate at this point, I don't > think. Am I wrong? I'm open to suggestions :-) Does this sound like > something you'd accept a patch for? -- Eddie Bush -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>