W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 1999

Re: Relocate vs Redirect

From: Yves Lafon <ylafon@w3.org>
Date: Thu, 11 Feb 1999 20:16:28 +0100 (MET)
To: Phil <phil@tcp.net.au>
cc: Jigsaw mailing list <www-jigsaw@w3.org>
Message-ID: <Pine.GSO.4.10.9902112013470.24582-100000@tarantula.inria.fr>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:28 GMT