This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am using webappcabaret to learn servlets and I have created some servlets successfully when I place them directly under my context name in the directory WEB-INF/classes but when I try to put servlets in a directory under classes it won't work. For example I created a TestServlet that just prints out a message and type this in the address bar: www.webappcabaret.com/amberw/servlet/Test.TestServlet. The error that I got was this: Error: 500 Location: /amberw/servlet/Test.TestServlet Internal Servlet Error: java.lang.NoClassDefFoundError: Test/TestServlet (wrong name: TestServlet) ...plus a bunch more junk I don't know what I am doing wrong. I am not sure if I need to put something in web.xml or not. Any Help is appreciated Thanks - Amber
"Happiness is a way to Travel, <b>Not</b> a Destination" -- Unknown
Amber: From what I understand using hints from the terms Test.TestServlet, you have a package structure for your TestServlet. Hence you should not put your class file in the WEB-INF/classes folder. You need to create a Test folder under classes and then copy your TestServlet.class file into the newly created Test folder. Correct me if I am wrong, meaning if you don't have a package structure in your TestServlet. regds. - satya