Java Redirect Problem

P

pat_cdp

Hi,

I have a need to conditionally navigate from a remote web page
which contains some html, some Java, and a signed java
applet, to a local html file. The condition will be based off of
a flag that I determine at run-time in a Java function; when the
condition is true, I want to redirect to something local, and
when the condition is false, I want to redirect to something
remote.

So far, I've tried document.write'ing various things from the the
javascript code (like adding a 0-second redirect, or adding a
'location.href = http://blahblahblah.com'.

I moved on to Java, where I've tried to change location by accessing
the DOM through JSObject and by trying various incantations to
getAppletContext().showDocument(). I was hoping that by running
in a secure context (from a SIGNED applet) I'd be able to
bypass these issues, but it doesn't help us directly. I can,
however, with the help of Java, run the browser from the command-
line with the new URL, and that will (sometimes) help us do what
I need, but it seems like a lot to go through to change a
simple URL.

Is there a blessed way to do this, or does this expose some
strange security issue?

TIA
 
C

Chris Uppal

pat_cdp said:
I have a need to conditionally navigate from a remote web page
which contains some html, some Java, and a signed java
applet, to a local html file. The condition will be based off of
a flag that I determine at run-time in a Java function; when the
condition is true, I want to redirect to something local, and
when the condition is false, I want to redirect to something
remote.

Just a thought, but I suspect that if you don't have difficulties now
persuading a browser to redirect from a page on the Web to a page on the user's
local filesystem, then you are likely to have problems in the future.

I'm not saying that it /is/ a problem, only that I think it /should/ be a
problem -- since (so far as the browser knows) no website can legitimately
know anything about the users local filesystem, any attempt to redirect there
is likely to be some sort of attack on the user's privacy. And so the browser
ought to refuse it.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Java Redirect Problem 0
Java Redirect Problem 0
Java 0
Java matrix problem 3
Java problem 1
Java OpenJDK Floating Point Dare 3
Java with Netbeans 2
Java MemoryLayout/ValueLayout Questions. 2

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top