Vous êtes sur la page 1sur 18

STS PREFERENCES

To Show the Project explorer

To disable the dashboard

Look for dashboard in the search box, and disable the news feed updates
checkbox

To disable, automatic updates look for updates in the search box and
disable, automatically find new updates and notify me, like this

To disable-enable validator, enable or disable the validator that you need

CREATE NEW SPRING MVC PROJECT


1. create new maven project

2. changing from standalone project to web project whit facets

Active the dynamic web module to 3.1

Add new jre to path library to matches java version used in Project facets
option
-

For this, delete the jre and add another one

Select the default selected 1.8

Adding the server run time for our tc server

Whit this, any http request and response can be resolved


3. Deleting webContent directory because it not comply whit maven
standard

4. Adding new webapp directory and adding it to deployment path

5. Creating the web-inf directory and web.xml configuration file

6. To test the application, create a jsp file whit the name home.jsp an
run it in the server

Configuring spring mvc framework in our project


1. downloading the dependencies
In the pom.xml file

In this case there is a problem, for the download active download index whit
this

Active the: Download repository index updates on startup" and Optionally,


check the boxes Download Artifact Sources and Download Artifact JavaDoc.
Next, download the next files

org.springframework spring-webmvc
slf4j-log4j13
log4j log4j

Add file for log4j library

The dispatcher is like other servlets in the web project, considering this, it is
configured like other servlets in the web.xml file

Making sure the maven dependencies make it in work in where that


deployment

Whit this we make sure all dependencies are placed in web-inf directory of
our work file

About the dispatcher-servlet.xml

the dispatcher-servlet.xml provide all the behavior for the container


been configured for our web application context
within spring mvc each dispatcher will mapped to an application
context
each application context represents an AOC container
within this dispatcher-servlet.xml we provide all configuration for
spring mvc

About the root application context

in this context we can provide all middle tier services, such as data
accesss or bussines context
this can be shared among all the other instances of dispatcher
servlets
if we can have two instances of dispatcher servlets the root
application context is avove of this two dispatcher instances

Configuring and creating the root application context


- it configure a number of beans within spring mvc framework
- mapp request

- data binding
- anotation for validation
- converters

Vous aimerez peut-être aussi