How I solved the problem - I was lucky that my luck worked. First, copy all the code from the book. DO NOT create a class folder inside web-inf for your project. In eclipse jee, create a new dynamic web project. Copy all the folders for jsp, html, java code, etc. From the old project to the new. Delete the old project. Create your new project (also try closing eclipse closure to be safe). Your project should now be error free. I have no explanation why this worked.
Alternatively , if your goal is to quickly learn J2ee JSP, etc., I suggest you not use Eclipse natively and manually create web application folders.
Create the following directory structure with all the necessary files:
C:\APACHE-TOMCAT-7.0.00\WEBAPPS\SAMPLEAPP ¦ MyHtml.html ¦ MyJsp.jsp ¦ +---WEB-INF ¦ DiceRoller.tld ¦ web.xml ¦ +---classes +---foo Dice.class
Now put all the necessary code for these files and it will work for sure. The moral of this story is that Eclipse is not very well versed in the basics of J2EE / Jsp / Servlets. Manually create your web application folders. I spent 2-3 hours trying to make an eclipse and still could not. I watched the non-eclipse and the code worked after 5 minutes. And ... there was no need to import any banks or expand any classes, etc.
Borat Sagdiyev May 23 '14 at 12:49 a.m. 2014-05-23 00:49
source share