Join AllAdvantage.com

WEBrewery


Tip #9: Protecting Your Applets from Theft

Sometimes you may post an applet that you don't want anyone else to copy and post on their own web site. A piece of code similar to the following will prevent an applet from functioning when not coming from a specified URL. This should of course be combined with obfuscation/encryption in order to be truly effective.

	public void init()
	{
		String host = getDocumentBase().getHost();
		if (!(host.equals("www.webrewery.com")) &&
			!(host.equals("webrewery.com")))
			return;

		// normal code goes here
	}


For Beginners | Jargon | General Tips | Swing | Books | Links | WEBrewery.com

Java is a trademark of Sun Microsystems.

Copyright © 1999 WEBrewery. All rights reserved.
Reproduction in whole or in part in any form or medium without
the express written permission of WEBrewery is prohibited.
brewer@webrewery.com

First aide kits

emergency first aid first aide kits emergency supplies store

www.ifirstaidkits.com