Java Tomcat Accounts


Requirements

Your account detail e-mail/letter
A basic knowledge of Java and Servlet technology

Using Servlets

Testing your account

To test your account is correctly set up for servlets, open up a web browser and go to

http://202.71.136.142:8080 /mountpoint / test2020

where

webserver is the name for your web server
mountpoint is the name of the mount points for servlets.

Both of these are in the account detail letter.

This should bring up a page looking like:

2020Media Apache Tomcat

Welcome to the world of servlets!

If this does not happen, then contact support at support@Hostonjava.com

Your Tomcat Servlet Account

Directory Structure

Home Directory/
                   html files
                       .
                       .
                   WEB-INF/
                            classes/
                                    class files
                                        .
                                        .
                            lib/
                                    jar files
                                        .
                                        .
                            web.xml
                    src/
                             source files
                                  .
                                  .
                    logs/
                              log files
                                  .

WEB-INF Directory

In your account there will be a directory called 'WEB-INF' with a sub-directories 'classes' and 'lib'. The 'classes' directory contains the classes for the test page and also for any servlets that you generate, and the 'lib' directory contains any jar files.

The mapping between the URL's and particular servlets is controlled via the XML file 'web.xml'. For each servlet that is directly accessed via a URL there are the following lines (for the servlet 'test2020'):

    < servlet >
        < servlet-name >
			 test2020
        < /servlet-name >
        < servlet-class >
		     test2020
        < /servlet-class >
    < /servlet >

    < servlet-mapping >
        < servlet-name >
		     test2020
        < /servlet-name >
        < url-pattern >
		     /test2020
        < /url-pattern >
    < /servlet-mapping >

An example version of the file, which runs the demo servlet is in the directory and it is recommended that you use this as a template.

Downloading Servlets

You can either download servlet class or jar files into the 'classes' or 'lib' directory or by downloading the source files and compiling them on the server. It is quite common for people to develop their applications 'off-line' and then just download the completed files when ready.

Compiling Servlets

Java 2 is installed on the server, and you can compile your servlets with javac.

For example the test servlet was compiled using

(in the src directory)

javac -d ../classes test2020.java

Debugging

Once the class files are installed, the main source of debugging information are the logs from Apache / Tomcat. These log files are available to developers on the password protected web page:

http://webserver/logs/errorlog.shtml

If you require further assistance then contact support@Hostonjava.com

Further Information

Using SSH

Using Servlets and MySQL

Finally

We hope that this page has made setting up and using servlets as painless as possible. If there is anything we have left out, or you have further comments, please send us an email at the usual support@Hostonjava.com

 

 

Linux Server's | NT Server's | Dedicated Server's | Domain Registration | Customer Support | Resellers | Mega Deal | Home

                                                             © Copyright 1997-2001 hostonjava.com. All rights reserved.