Java Reference
In-Depth Information
This page just sets up form-based user authentication. Note that this code also uses
the Spring form tags as view helpers to display error messages resulting from login
failures.
Now that some code is in place, you need to build and test this application on the
Tomcat 5.5 web server. To build the OMSWeb application, you need to select the project
and run the Maven install goal as shown earlier in this chapter. The install goal will also
run any JUnit tests that you may have written. By default, Maven uses JUnit for unit tests.
You can also use any other testing framework, such as TestNG, as well. On a successful
build, the install goal generates a WAR file. In the next section, I will present a step-by-
step guide to install this WAR file on Tomcat 5.5. To follow the next section, you will need
to download, install, and start the Tomcat web server. You can get detailed instructions
Deploying the Project
Maven 2 provides a plug-in to deploy the generated WAR file in the Tomcat 5.5 server. You
need to install this plug-in before you can actually use it. The steps to adding this plug-in
are the same as setting up the dependencies. To add the Maven 2 Tomcat plug-in, right-
click the OMSWeb project to launch the context menu. In the context menu, select
Maven
รค
Add Plugin. This is shown in Figure 7-14.
Figure 7-14.
Adding the Maven 2 plug-in
On the Add Plugin screen that appears, type
tomcat
in the Query box. Select the
Tomcat Maven plug-in as shown in Figure 7-15, and click OK. This automatically down-
loads the relevant JAR files required by this plug-in.

