Does the server know the page URL of the applet without asking the applet?
There's Applet.getDocumentBase()
to handle that from the applet itself but I was wondering if there was a way on the server without referring to the applet.
Does the server know the page URL of the applet without asking the applet?
There's Applet.getDocumentBase()
to handle that from the applet itself but I was wondering if there was a way on the server without referring to the applet.
There isn't a simple way to get an applet page from the server even with client server communication. I tested HTTP connection and it did not set the referrer page when it connected (it may work of other machines but it looks like it cannot be relied on). Any other connection will not have any idea of web pages. Therefore the best guarantee of knowing what page the applet is used on is your current way - sending it from the applet.
I'm unsure why you would want to do this really.
If you're interested in tracking users from different pages you should probably use web logging.
If you wish to have different applet functionality according to web page then parameters
are probably a better option.
If you want to ensure that someone doesn't steal your applet to use on another site it shouldn't be of concern - an applet can only connect to the same domain it was loaded from. (Someone could in theory modify the settings on their own machine to get round this though.)