[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qexo-general] base-uri(node) implemented
From: |
Per Bothner |
Subject: |
Re: [Qexo-general] base-uri(node) implemented |
Date: |
Sat, 15 Feb 2003 16:01:10 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 |
ivelin wrote:
I am still expecting your comments on the proposed CallContext.getResource
which allows relative URLs.
Sorry. Finally I have a little more breathing room. (But I'll
be away from phone or email Sunday morning until Monday afternoon.
I think we want to be able to *set* the context of relative url
in non-servlet environments. Thus we need (in CallContext):
protected Object baseUri;
public void setBaseUri (Object baseUri) { this.baseUri = baseUri; }
public Object getBaseUri () { return baseUri; }
I'm not sure what the type of baseuri should be: a String?
a URL? a URI (in 1.4)? sometimes a File? So I punted, and
just make it Object.
We might have the KawaServlet init method do setBaseUri.
If we have getBaseUri, then I don't think we don't need
getResource, at least not in CallContext. However,
we still need a helper routine to resolve a relative URI
relative to a base URI. JDK 1.4 has USR.resolve, but I
don't want to force people to use 1.4. So we need a
helper routine. This could also be in CallContext, I think:
Object getResolvedUri (String name) { ... }
Can this be written purely in terms of getBaseUri? (If so,
we don't need to override it in ServletCallContext.) What
about getResolvedUri("/...")? Your code would resolve
it relative to the servlet context, which is reasonable.
So I guess we may need to override it in ServletCallContext,
after all.
Does this make sense?
--
--Per Bothner
address@hidden http://www.bothner.com/per/