It's a small chunk of Java bytecode that is used on (mainly) websites. It performs some (web related) task in realtime using the Java Virtual Machine on your computer.
It is one of the main concepts of advanced java which can implemented various designing by using the java projects and ejb projects.