Tag: dispatch-servlet.xml

Updating Web.xml and Dispatch-servlet.xml No ratings yet.

Before running the app, you need to setup the web.xml, dispatcher-servlet.xml and other property files properly. Let’s update the web.xml file by right-click src/main/webapp/WEB-INF/web.xml => Open With Text Editor and then update with below settings:   <?xml version=”1.0″ encoding=”UTF-8″?> <web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd” id=”WebApp_ID” version=”2.5″>        <display-name>SpringMVCExample</display-name>        <welcome-file-list>        <welcome-file>index.html</welcome-file>    

Spring Configuration and ServletInitizer No ratings yet.

Starting from Spring 3.1, you can run the app without web.xml and dispatch-servlet.xml. Simply storing all your settings in Spring configuration and servlet initizer, it helps to simplify the web configuration with Spring. Let’s create a Spring configuration file called AppConfiguration.java under src/main/java/com/itblogs/config/ as: package com.itblogs.config; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import