• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting started with J2EE

 
John Sears
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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:

BasicFilter.java


HelloWorldSession


HelloWorld.jsp


web.xml




I put these files into the following directory structure:

/Projects/HelloWorld/HelloWorld.jsp
/Projects/HelloWorld/WEB-INF/web.xml
/Projects/HelloWorld/WEB-INF/world/hello/BasicFilter.class
/Projects/HelloWorld/WEB-INF/world/hello/HelloWorldSession.class

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!
John
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
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
Greenhorn
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