jadrijan
jadrijan

Reputation: 1446

How to mask URL opened by Applet?

If I use the following lines of code in Java I will be redirected to a newpage.html in the same window and frame where the applet's HTML page is (page.html). I am trying to mask the URL so that it still displays page.html in the address bar of the browser when I am redirected to newpage.html.

How would I do this?

URL url = new URL(getCodeBase().getProtocol(), getCodeBase().getHost(), getCodeBase().getPort(), "/newpage.html");
getAppletContext().showDocument(url, "_self");

Upvotes: 0

Views: 142

Answers (2)

Pool
Pool

Reputation: 12362

Difficult to give a proper answer without understanding the rational for doing this.

However, maybe page.html can load a file which uses an iframe, and the iframe reloads. This way the page URL will still be page.html.

Upvotes: 0

SLaks
SLaks

Reputation: 888185

For security reasons, you can't do that.

Upvotes: 3

Related Questions