Monday, April 16, 2007

 

Web Programming 1000

Okay, I know, you're wondering what the 1000 is.
Well, I went to the University of Lethbridge and we had four-digit course numbers. So think of it as Web Programming 101 with a U of L flair.


The Eclipse IDE

In general, I like the Eclipse IDE. It's free, it's pretty rich as far as features:

All but the last one I use quite often. I fought and I fought with the Tomcat integration plug-in. Sure, it installed just fine but I could not deploy an app to it to save my life. So, in my disappointment, I turned to ant.

Apache Ant is a program/framework which allows you to specify different targets (typically dist, deploy, test, clean) with tasks (including compilation, moving, copying, deleting, running certain programs). Gustavo, who I work with, helped me with learning Ant and I am excited with it. It means you don't have to be bound to an IDE for making your projects work (although compiling inside an IDE is a good way to work the bugs out) and your directory structure can be whatever you want it to be.

Directory Structure



I don't know standards, best-practices or conventions when it comes to directory structures. I know what tomcat wants when you deploy an application to it (since that's what I've been working on) so I have set up a directory structure that I'm comfortable with and I let my ant tasks put stuff where it needs to be.

Here's my directory structure:

Project folder
- Java
-com/org
-continue ad nauseum
The java and subfolders are where you'll find the java source code for the classes that I have written.
-Dependencies
-jars
-tlds
The dependency folder with its subfolders is where you will find the external classes/programs/libraries that I use in my project
-html
-jsp
-javascript
-html
The html folder is where you will find the front-end code - JSPs, HTMLs, javascript files, etc.
-web.xml
-struts.xml
-validation.xml
these files are stored directly under the main project directory. web.xml describes the application - entry points, etc. struts.xml does the same thing if the project is a struts 2.0 project. validation.xml describes the validation required on some web-pages. It's just an example of the xml files that will be under the main directory. Obviously there could be more.

I'm pretty much a beginner on this stuff, myself. I want to learn more about web.xml and struts.xml and figure out how to frame these files properly.

That and the specific ant tasks are what I'll write about next time.

Labels: ,


This page is powered by Blogger. Isn't yours?