wood burning stoves 2.0
The moose likes Servlets and the fly likes Getting started with J2EE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting started with J2EE" Watch "Getting started with J2EE" New topic

Getting started with J2EE

John Sears

Joined: Sep 15, 2009
Posts: 14
I'm trying to get started learning some technologies for a project I'm working on (struts2 on WebLogic 10), but I'm having a hard time getting just a very basic HelloWorld app going. I have never worked with enterprise 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!
Rob Spoor

Joined: Oct 27, 2005
Posts: 20136

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.

How To Ask Questions How To Answer Questions
John Sears

Joined: Sep 15, 2009
Posts: 14
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!
I agree. Here's the link: http://aspose.com/file-tools
subject: Getting started with J2EE
It's not a secret anymore!