> Overview (Steps)

Struts lesson 1: HTML-files packed into a WAR (Web-ARchive)

For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

Last revision of this document:
2005-06-21

This document describes the creation of 3 HTML-files in different sub-directories using the Struts-framework (see JS_Struts00) under Eclipse, packing them into a WAR and deploying the WAR-file to JBoss-Java-Application-Server.

Credits:

I derived that lesson from a lot of sources found in the internet. I thank the numerous authors for their contribution.

Prerequisites:


Preparation:

Create a new project (named JS_Struts01) by copying the Struts-framework (JS_Struts00):

In the 'Package Explorer' window you should see a new project with the name 'JS_Struts01' with the following structure.
(You can expand/collapse the structure by clicking onto the triangles left of the folders.)

Create the subdirectories:

top.

Writing the HTML-code:

Write the start-page (index.html).

Aim of this lesson is mainly to pack HTML-files into a WAR; so the HTML-code is kept pretty simple.
There is one 'index.html' file which has a little bit of text and 2 links to HTML-files in different sub-directories.

Write the sub-pages (sub_page_1.html and sub_page_2.html).

Repeat the two previous steps for the 'sub_directory_2' and create a file sub_page_2.html.

Hint: Eclipse shows all HTML-files in error. These are false errors due to misinterprtation of the <br> tag

top.

Making the packaging configuration and pack the HTML-files into a WAR (Web-ARchive):

The advantage of a WAR-file is, that a complete project can be transfered to a Web-Appliocation-Server.
This minimizes the danger of missing files for the transfer and have an incomplete or inconsistant Site presented.

Define, which files are packed into the WAR.

top.

Run / Test:

Note: There is also a functionality in Eclipse to define the Java-Application-Server and deploy and undeploy with an Eclipse-function.
I was not pretty happy with that feature. My JBoss-Application-Server is running on another machine. When this machine is not running during the start of Eclipse, the Eclipse-function gets confused, reports that a changed WAR-file is deployed - but the old file is not overwritten.
So i stayed on the more secure side and copy the files using the 'Terminal'-window.




top.

Related Documents: