Exercises, examples and other material relating to training module A653. This topic is presented on public courses
Deploying Apache and Tomcat,
Deploying Java Applications on Linux / Unix
One you've installed and tested Tomcat on your server, you'll want to deploy your own applications. This module shows you various ways of installing such an application on a default Tomcat configuration, and shows you what's in the various deployment files.
Related technical and longer articles
Running SSI (Server Side Include) scripts in Apache TomcatRunning CGI scripts in Apache Tomcat
Articles and tips on this subject | updated |
3996 | Tips on Tomcat - moving applications around If you want to replace the root application on your Tomcat server, you can replace the ROOT folder in webapps. But there's alternatives that might be better for you.
a) Place the .war file and / or application in webapps, and replace the ROOT folder with a symbolic link to the application:
cd ... | 2013-02-07 |
3044 | Changing a Servlet - more that just editing and compiling If you're going to modify a servlet, you'll need to edit and recompile the classes that you're changing - and chances are that will include the main application class. Which means you need to have access to the source. Not a problem if you're a developer of the product, but could be an issue if it's ... | 2010-11-12 |
2088 | Changing the 404 - file not found - page in Tomcat If you're running an Apache Tomcat web server, how do you customise your error documents? Add an <error-page> tag set into your web.xml file
To change this:
into this:
I added the following to by web.xml:
<error-page>
<error-code>404</error-code>
<location>/broken.html</location>
</error-page>
and ... | 2009-03-17 |
1006 | Apache httpd and Apache Tomcat together tips Many sites run two web servers - Apache httpd is ideal for plain HTML documents and scripts / programs that are single pages, run rarely, not all linked in together. Whereas Tomcat is an application container that suits applications that are run by tens of people all at the same time - great for banking, ... | 2008-12-21 |
1909 | javax.servlet cannot be resolved - how to solve Two common problems in compiling Servlets for use within a Tomcat container ...
PROBLEM: My Java Compile of a Servlet says "javax.servlet cannot be resolved"
For example:
[trainee@easterton sources]$ javac Smallest.java
----------
1. ERROR in Smallest.java
(at line 2)
import javax.servlet.*;
^^^^^^^^^^^^^
The import javax.servlet cannot be resolved
----------
2. ERROR in Smallest.java
(at line 3)
import javax.servlet.http.*;
^^^^^^^^^^^^^
The import javax.servlet cannot be resolved
----------
3. ERROR in Smallest.java
(at line 5)
public class Smallest extends HttpServlet {
^^^^^^^^^^^
HttpServlet cannot be resolved to a type
----------
4. ERROR in Smallest.java
(at line 9)
public void doGet(HttpServletRequest request,
^^^^^^^^^^^^^^^^^^
HttpServletRequest cannot be resolved to a type
----------
5. ERROR in Smallest.java
(at line 10)
HttpServletResponse response)
^^^^^^^^^^^^^^^^^^^
HttpServletResponse cannot be resolved to a type
----------
6. ERROR in Smallest.java
(at line 11)
throws IOException, ServletException
^^^^^^^^^^^^^^^^
ServletException cannot be resolved to a type
----------
6 problems (6 errors)[trainee@easterton sources]$
SOLUTION: ... | 2008-11-26 |
1564 | Default file (MiMe types) for Apache httpd and Apache Tomcat Apache Tomcat web server default MIME type
What file extension maps to what "Mime Type" in Apache Tomcat? It's important to know, since the Mime type is sent out by the server to the browser to tell the browser how to handle the following data stream.
a) There is a long list of extensions and their ... | 2008-03-05 |
1552 | Extra public classes in deploying Apache httpd and Tomcat We have just scheduled an additional two Deploying Apache httpd and Tomcat courses, to start on Monday 3rd and Wednesday 5th March 2008. This course is "flavour of the month" - I ran such a course the week before last, a tailored private course last week ... and I have another public course scheduled ... | 2008-02-24 |
1192 | What are WEB-INF and META-INF directories? If you're looking at a web application on your Tomcat server you'll see all the files that you would expect - things like an index.html (or perhaps an index.jsp), images, and perhaps style sheets, a robots.txt and a favicon.ico. You'll also see a WEB-INF directory, and perhaps a META-INF directory that ... | 2007-05-21 |
1082 | Straight from the .jar Disc drives have got much faster since my youth ... and processors at have got much much MUCH faster in the same period. So, 30 years ago, we used to compress files to store them on the disc when we knew we weren't likely to keep needing them, but we didn't compress them as a matter of course as we ... | 2007-02-16 |
1074 | Java beans and classes, .war and .jar files A Java Bean is a class that includes a constructor that takes no parameters, and getter and setter methods with names like getLength and setLength to read and write properties. So at a basic (Java) level, a bean is just a class that happens to conform to some conventions. However - when you come to ... | 2007-02-10 |
754 | tar, jar, war, ear, sar files Have you ever wondered why that are so many file extensions ending in "a r"? It's because the "ar" stands for archive, and it's such a reasonable way of naming file that the original tar which stands for tape archive was picked up by Sun and the Java community and transmuted into other file formats.
tar ... | 2006-06-13 |
465 | Changing Tomcat's web.xml and reloading a web application In the Tomcat Manager, does the "Reload" button on each application do just the same thing as "Stop" followed by "Start"? You might think so ... but, no, it doesn't.
If you stop and restart your application by using the two buttons, your web.xml configuration file will be read and any changes that ... | 2006-06-05 (short) |
Examples from our training material
Pictures
Java and Tomcat deployment - webapps structure
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
[here].
Topics covered in this module
Installing a flat files example in /webapps/.
A more complex application in a /webapps/ folder.
Installing a Java Server Page in /webapps/.
An example that reads from a form.
An example with error checking, and with the form within the JSP.
Deploying a Servlet in /webapps/.
A Servlet with form data.
Using a JSP to access a class.
Installing via a WAR file.
Installing Servlets from the server.xml file.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Linux and LAMP,
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.