this is the ajaxguessnumber example (modified to work on "keyup") from the oracle tutorial. you cant download this directly from oracle...they just make it overly complicated to get the turotial.
its been modified to work with maven2.
all you need for the above .war archive is glassfish/tomcat/other app that can read .war archives.

the example lets you input a number and when you release the number key you pressed the server will read the input and report back to you if you guessed the right number.