This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See java before. As I understand it, the J2EE specification calls for a specific directory structure for a web application. My goal is to put together an application that runs a filter to catch all references to .do files, captures the time they were created (just so I can get an attribute to save), then forwards the request to a JSP that prints a hello message and the time.

If I understand correctly, an enterprise web application needs the following structure (simplified): JSPs in the root directory, and a WEB-INF directory with web.xml and the server-side classes. I guess any referenced jars should go in WEB-INF/lib too.

So, my design is as follows:




I put these files into the following directory structure:


When I deploy to WL10, it says that it can prepare correctly but when I try to start it I get java.lang.ClassNotFoundException: world.hello.BasicFilter. I've tried moving the class files directly into the WEB-INF directory and into the HelloWorld directory as well...same error.

If anyone could point me along I would be very grateful! I'm excited to get a skeleton web app going so that I can begin to experiment with frameworks like struts and later Spring.

Thank you for any help!
Posts: 21208
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be /Projects/HelloWorld/WEB-INF/classes/world/hello/BasicFilter.class

Moving to Servlets as filters and the web application structure are closely related to servlets.
John Sears
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah thank you very much. I didn't realize that that was the convention. My next step will be to package these into an archive-- I believe the way to do this is to put together an Ant build file and create a war? I understand I could also use Maven...

Anyway, thanks again!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!