Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Spring MVC Beginner's Guide

You're reading from   Spring MVC Beginner's Guide Your ultimate guide to building a complete web application using all the capabilities of Spring MVC

Arrow left icon
Product type Paperback
Published in Jun 2014
Publisher
ISBN-13 9781783284870
Length 304 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Amuthan Ganeshan Amuthan Ganeshan
Author Profile Icon Amuthan Ganeshan
Amuthan Ganeshan
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Configuring a Spring Development Environment 2. Spring MVC Architecture – Architecting Your Web Store FREE CHAPTER 3. Control Your Store with Controllers 4. Working with Spring Tag Libraries 5. Working with View Resolver 6. Intercept Your Store with Interceptor 7. Validate Your Products with a Validator 8. Give REST to Your Application with Ajax 9. Apache Tiles and Spring Web Flow in Action 10. Testing Your Application A. Using the Gradle Build Tool B. Pop Quiz Answers Index

Time for action – configuring Tomcat on STS

As I already mentioned, we can use the Tomcat web server to deploy our application, but we have to inform STS about the location of the Tomcat container so that we can easily deploy our project from STS to Tomcat. Let's configure Tomcat on STS:

  1. Open STS from the start menu option or the desktop icon.
  2. STS will ask you to provide a workspace directory location; provide a workspace directory path as you wish and click on the OK button.
  3. Now, STS will show you a welcome screen. Close the welcome screen and go to the menu bar and navigate to Window | preferences | Server | Runtime Environments.
  4. You can see the available servers listed on the right-hand side; you may also see VMware vFabric tc Server listed under the available servers, which comes along with the STS installation.
  5. Now click on the Add button to add our Tomcat web server.
  6. A wizard window will appear; type tomcat in the Select the type of runtime environment: text box, and a list of available Tomcat versions will be shown. Just select Tomcat v7.0 and select the Create a new local server checkbox. Finally, click on the Next button, as shown in the following screenshot:
    Time for action – configuring Tomcat on STS

    Selecting the server type during the Tomcat configuration on STS

  7. In the next window, click on the Browse button and locate Tomcat's installed directory, and click on the OK button. You can find Tomcat's installed directory under C:\Program Files\Apache Software Foundation\Tomcat 7.0 if you have installed Tomcat in the default location. Then, click on the Finish button, as shown in the following screenshot:
    Time for action – configuring Tomcat on STS

    Selecting the Tomcat location during the Tomcat configuration on STS

What just happened?

In step 2, we provided a workspace path for STS. When you open STS for the very first time after installing STS, it will ask you to provide a workspace location. This is because when you create a project on STS, all your project files will be created under this location only.

Once we enter STS, we should inform STS where the Tomcat has been installed. Only then can STS use your Tomcat web server to deploy the project. This is also a one-time configuration; you need not perform this configuration every time you open STS. We did this by creating a new server runtime environment in step 5. Although STS might come with an internal VMware vFabric tc Server, we chose to use the Tomcat web server as our server runtime environment.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime