> -----Original Message-----
> From: Alexander Brill [mailto:[EMAIL PROTECTED]
>
> Is it possible to access java variables within Webware? I
> came across a
> problem with IE's handling of the META refresh (it can't load other
> documents). So I'll somehow need to break the process of writing my
> pages (so that the user can get a fair chance in clicking a
> link to the
> new page instead).
>
> To further understand my problem I've got some code here for you:
> def writeHeadParts(self):
> self.writeTitle()
> self.writeStyleSheet()
> self.writeln('''
> <script LANGUAGE="JavaScript">
> <!--
> if (top.location.href.indexOf("index.html") == -1)
> document.writeln('<META http-equiv="refresh"
> content="1,http://www.foobar.com">');
> // -->
> </script>
> ''')
>
> def writeBodyParts(self):
> if isIndex: #We are on the wrong page the java said
> self.writeln('Click <a href="http://foobar.com">here</a>')
> else:
> self.writeHeader()
> self.writeMain()
> self.writeFooter()
>
>
> So in essence, I will need to have the
> isIndex = top.location.href.indexOf("index.html")
I am having a little trouble following what you are trying to do here.
Perhaps some additional contextual information would help. How is it that
the servlet generating the HTML and your Meta tag does not know the URL that
has been requested? Shouldn't it be able to detect the URL requested and
then just do a redirect? Note that the W3C recommends against Meta refresh
in favor of Server Redirects.
The "top.location.href.indexOf" is a JavaScript statement presumably, and
that is only available in the browser client. I am not sure how it could be
expected to be directly available on the server where Webware runs. The
only way that comes to mind is to send it to the server when sending a
request.
(disclaimer: it has been a while since I did much JavaScript development.)
Another idea is that since you are writing JavaScript to the client to
generate the META tag, couldn't you instead have the JavaScript load the new
page by setting the top.location.href? (note my disclaimer)
Now back to your original problem, of the Meta tag being unable to load
other documents. This is a pretty common use of the Meta refresh tag. All
of the examples I have seen use a slightly different format than you listed
in your example. Here is one used on MSNBC to redirect to their Technology
section.
<META HTTP-EQUIV=REFRESH CONTENT="7;
URL=/news/TECH_Front.asp?0dm=C---T&ta=y">
Note they have the URL= tag embedded within the content.
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss