I just started reading an older book on servlets but i haven't read into it that far. Maybe the first three chapters. I was wondering if anyone one can tell me what is the difference between a bean and a servlet and are there different advantages to using one over the other?

The servlet examples in the book generate html via println statements which according to another book i read on jsp is no longer acceptable. I can see why for various reasons but some of the servlet examples shown do things i havent seen done with beans such as read parameters out of web.xml files.