Re: Relocate vs Redirect

On Wed, 10 Feb 1999, Phil wrote:

> I have several virtual hosts that need access to a single instance of a servlet.
> 
> There is an indexer extension 'html' with a RelocateFrame. The relocate attribute is set to '/servlets/TheServlet'
> 
> This works ->   http://localhost/servlets/TheServlet
> This doesn't -> http://virtual.localhost/servlets/TheServlet
> 
> The error from the virtual.localhost request is:
> 
> The URL http://localhost/servlets/TheServlet that you requested is not available on that server.
> 
> I had this problem before with a RedirectFrame as the request came from a virtual host and the resource was on the root host. Benoit suggested using a RelocateFrame  though I'm not sure if the location I've entered is correct.

I fixed the redirecter frame already
(org.w3c.jigsaw.frames.RedirecterFrame) so that virtual hosting is taken
into account, see the fix here or get it from the Cvs public tree
(http://dev.w3.org/cgi-bin/cvsweb/java/)
I will also take a look at the relocateframe.

    public ReplyInterface perform(RequestInterface req) 
        throws ProtocolException, ResourceException
    {
        Reply        reply  = (Reply) performFrames(req);
        if (reply != null) 
            return reply;
        Request request = (Request) req;
        httpd    server = (httpd) getServer();
        String     host = request.getHost(); 
        request.setReferer(getURLPath());
        try {
            if (host == null)
                request.setURL(new URL(server.getURL(), getTarget()));
            else 
                request.setURL(new URL(server.getURL().getProtocol(),
                                       host, getTarget()));
        } catch (MalformedURLException ex) {


> 
> The API says that ATTR_LOCATION is 'The relocation location'
> and getLocation() returns 'a string, containing the relative path.'
> 
> So... i've tried 'servlets/TheServlet' and '/servlets/TheServlet' and both return the same message.
> 
> What silly thing have I done?
> 
> Thanks again,
> 
> Phil
> ---------------------------------------------------------
> Phil Blake                                phil@tcp.net.au
> Translation Creation Production     http://www.tcp.net.au
> 32 Harrow Road                         tel +612 9519 4235
> Stanmore NSW 2048                      fax +612 9519 9445
> Australia                          toll free 1800 242 954
> 
> 
> 
> 

      /\          - Yves Lafon - World Wide Web Consortium - 
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    

Received on Thursday, 11 February 1999 14:16:36 UTC