u'll find some example applications at hotscripts.com
http://www.hotscripts.com/Java/Apple...ems/index.html
in respect of security u may read apache docs on ssl
are u sure u want to write that in java? php would be a nice alternative. many scripts already available for free ...
If u dont want to use an applet u need an application server and use servlet technology