This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
To run your standalone program you have to set up your classpath correctly. To run your servlet you have to set up your web application correctly. This has nothing to do with the code and everything to do with configuration. So it's perfectly possible to get one right and one wrong, and you've done that.
So whining for us to run your code is not useful, since it's the configuration which is the problem, not the code, and you haven't shown us your configuration.
If you're wondering what configuration I'm talking about, well, Jesper already told you what to do. It sounds like you decided to reject that advice and post that last unfortunate post instead.