Sure, you can submit a form or cause a link to activate a
servlet on the server. Alternatively, you could employ Ajax to make a request to a servlet.
Or, a JavaScript library named DWR uses Ajax and servlets to allow you to make what seem to be RPC-like calls to Java methods.
All that assumes, of course, that you are talking about running Java code that resides on the server. If it is client-side Java that you are asking about, then an applet is necessary.
[ June 24, 2007: Message edited by: Bear Bibeault ]