Web applications with CodeGuide

 

Configuration

CodeGuide works with Tomcat version 4.0 and 4.1. Support for Tomcat has to be configured in the Integration | Paths section of the Preferences dialog.

 

Directory structure

The directory structure Web applications generated by CodeGuide is similar to the general Tomcat Servlet engine directory structure.

 

conf/

Contains the configuration files for the Tomcat servlet engine. The most important are server.xml and web.xml, the main configuration files of Tomcat.

logs/

Contains several logs files.

src/

Contains the source for servlets and JSP helper classes (if any).

webapps/

Contains the actual web applications. No files should be located in this directory.

webapps/$webapp$/

Contains the web application which was generated by CodeGuide.

 

This directory can contain .html files, .jsp files and images.

webapps/$webapp$/WEB-INF/classes/

Contains compiled servlets and helper classes.

webapps/$webapp$/WEB-INF/

Contains web.xml, the configuration file for the web application.

 

You may need to modify this file if you add additional servlets.

webapps/ROOT/

Contains the ROOT web application.

work/localhost/

Contains temporary files used while Tomcat is running

work/localhost_8080/$webapp$/

Contains the .java files generated from .jsp files.

 

Please substitute $webapp$ for the actual name of the web application.

 

Each web application $webapp$ can be accessed at http://localhost:8080/$webapp$/ once the Servlet engine is running except for ROOT which is located at http://localhost:8080/.

 

Adding files

After creating the project a sample servlet/JSP page is created. Additional servlets, .jsp files, .html files, etc can be added to the web application at the proper location.

 

.html, .jsp files

Those files can be added in the webapps/$webapp$ or in subdirectories of this directory.

 

Source code for other servlets

 

Source code for other servlets can be added in src/. Please note that you have to modify the webapps/$webapp$/WEB-INF/web.xml file if you add/remove servlets.

 

Source code for helper classes

Source code for helper classes can be added in src/ as well. You can even create a package hierarchy below this directory.

 

Migrating existing web applications

The best way to migrate existing web applications is to create a new Web application project (JSP) from within CodeGuide first and copy the existing web application into the webapps/ directory afterwards. You might have to modify some of the configuration files as well but web applications are designed to be portable between servlet containers.

 

Developing web applications using other Servlet engines

You can develop web applications using any pure Java Servlet container with CodeGuide. However only Tomcat is supported in CodeGuide so you have to do configure the Project Settings for other servlet containers by hand.