Hans Bergsten wrote:

> Christopher Cobb wrote:
> >
> > > Actually, I tried opening the .html file and just sending the bytes back to the
> > > browser.  This didn't work either because the 'environment' (current document
> > > directory, etc.) was not correct.  It happens that the .html file I'm trying to 
>open
> > > uses frames.  It could not find the frame pages because the environment was still
> > > set to the servlet's environment rather than the .html file's environment.
> >
> > Hans Bergsten wrote:
> >
> > > You can probably solve that problem by adding a <BASE HREF> tag in the <HEAD>
> > > part of the HTML file, e.g.
> > >
> > >   <HEAD>
> > >   <BASE HREF=/base/path/for/frame/pages>
> > >   </HEAD>
> >
> > Excellent suggestion!  Unfortunately, even with the <BASE> tag as the first thing
> > in my <HTML> tag, I still get the following error message:
> >
> > "Netscape is unable to find the file or directory named /xyz/logo.html.  Check the
> > name and try again."
> >
> > The funny thing is, /xyz/logo.html is exactly the right name.  I still think there
> > is something funny in the environment that the servlet has defined vs the 
>environment
> > that the web page needs.
>
> The browser only cares about URLs. It has no idea how the HTML pages was generated.
> So if the URL for the current page is /servlet/theServletThatGeneratedThePage
> and you have a relative URL in the page, e.g. logo.html, the browser will form
> an absolute URL based on the current URL, i.e. /servlet/logo.html in this example.

Yes, I'm following you so far.

> If you use a <BASE HREF> tag, the browser will use it instead of the current URL
> to resolve relative URLs.

OK.  What I have in my 'toplevel.html' file is:

<HTML>
<HEAD>
<base href="/xyz/toplevel.html">
<TITLE>...</TITLE>
</HEAD>
<frameset ...>
 <frame src="logo.html" ...>
...
</HTML>

This was a page authored by someone else.  There is no <body> tag here, and I assume 
this is correct with respect to using framesets.

If I type http://localhost/xyz/logo.html into the browser's location field, it has no 
problem finding it.

And if I type http://localhost/xyz/toplevel.html, everything looks fine.

But if I type http://localhost/servlet/GuardServlet/xyz/toplevel.html, I get the 
'unable to find /xyz/logo.html' message for each frame in the set.

> Finally, if you use absolute URLs there's no resolving needed so the browser
> goes out and asks for the URLs exactly the way they are defined in the page.

Well, absolute references don't work either.  If I change my toplevel.html file to be:

...
<base href="/xyz/toplevel.html">
...
 <frame src="/xyz/logo.html" ...>
...

(changing the frame reference to be absolute instead of relative) I still get the same 
'unable to find /xyz/logo.html' error as before.

The only reference that works is a fully qualified URL:

...
<base href="/xyz/toplevel.html">
...
 <frame src="http://localhost/xyz/logo.html" ...>
...


> So take a close look at you HTML file again. Is the <BASE HREF> in the <HEAD>
> part of the page, as opposed to the <BODY>? You mentioned frames. Did you add
> the <BASE HREF> to both the page with the FRAMESET and the pages shown in the
> frames?

Are you saying that I need to add a <BASE ...> tag to each frame file?  But it's not 
getting that far:  it can't locate the frame file at all so the contents of the frame 
file surely don't matter (yet).

> There must be some mistake of this nature. Again, if the HTML is correct
> the browser couldn't care less about how it was generated.

Since there is only two short html files involved here (one with 32 lines and another 
with 13 lines), I would be happy to have anyone examine them more closely (they are 
attached to this message).  Again, I am not the author of these pages.  I'm just 
trying to get them to work with JSP.

BTW, thanks for your lengthy and patient reply.

Chris

Title: Electronic Commerce
<p> The EC21 Application requires a frames capable browser. Please obtain a frames capable browser.&nbsp; Either <a href="http://www.microsoft.com/ie/">Internet Explorer</a> or <a href="http://www.netscape.com">Netscape Navigator</a> will work.</p> <p>There is no non-frames version.</p> <p>Any questions or comments please email <a href="mailto:[EMAIL PROTECTED]">EC21 Project</a> or call 703-648-7077.</p> <hr> <font size="-1">Page Last Modified <SCRIPT LANGUAGE="JavaScript1.1"> <!-- Begin date = new Date(document.lastModified); document.write(date.toLocaleString()); // End --> </SCRIPT> by <a href="mailto:[EMAIL PROTECTED]">KHS</a></font>
Electronic Commerce for the 21st Century
OFSS presents EC21
Office of Federal Systems and Services
begin:vcard
n:Cobb;Christopher
tel;cell:703-909-7550
tel;fax:703-648-7475
tel;work:703-648-6725
x-mozilla-html:TRUE
org:Powerhouse Technologies, Inc.
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
title:SW Architect
fn:Christopher Cobb
end:vcard

Reply via email to