On Mon, Mar 01, 2004 at 11:15:34AM +0000, Mike Taylor wrote:
> > From: "LeVan,Ralph" <[log in to unmask]>
...
> > Your java test just tells me that
> > the URL constructor is in error.
>
> Agreed.
I am happy with database names not starting with '/', but just wanted
to quash the idea that the Java URL constructor was necessarily in error.
URLs normally have a protocol and an absolute path. Absolute paths start
with a leading '/'. That is, the grammar says you have "http://host:port"
plus an absolute path such as "/a/b/c". Its not "http://host:port/" plus
a path of "a/b/c".
It is arguable that the Java constructor (and the C++ and C# ones too)
should throw an exception if the supplied path does not start with
a '/'. You cannot use a relative path (one that does not start with
a '/') after the protocol part. It must be absolute. Web browsers
are able to convert relative URLs (with no protocol part) into absolute
paths with a protocol using the URL of the current page.
So if database names do not start with a '/', from a URL perspective
they are a relative path. This sounds fine to me. If you want to
construct a full URL, you need to turn it into an absolute path by
adding a leading '/' before passing to the URL constructor functions.
Sorry, not trying to lecture etc to people - just wanted to make sure
minor technical inaccuracies did not propergate. I might have missed
the point of what people were saying too of course.
I also think its better to leave the leading slash off by the way.
Its also generally easier to add a character than remove one (eg: in
XSLT etc). You can remove a leading slash if need be, but adding
one is generally trivial. Oh, and its also what the spec says ;-)
Alan
|