alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Spring Framework example source code file (web.xml)

This example Spring Framework source code file (web.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Spring Framework tags/keywords

a, a, applied, can, database, database, dispatcherservlet, has, image, image, loads, mvc, the, the

The Spring Framework web.xml source code

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

	<display-name>Spring Image Database

	<description>Spring Image Database sample application

	<!--
		- Location of the XML file that defines the root application context.
		- Applied by ContextLoaderServlet.
		-
		- Can include "/WEB-INF/schedulingContext-quartz.xml" for Quartz scheduling,
		- or "/WEB-INF/schedulingContext-timer.xml" for Timer scheduling.
	-->
	<context-param>
		<param-name>contextConfigLocation
		<param-value>
			/WEB-INF/applicationContext.xml  /WEB-INF/schedulingContext-quartz.xml
		</param-value>
		<!--
		<param-value>
			/WEB-INF/applicationContext.xml  /WEB-INF/schedulingContext-timer.xml
		</param-value>
		-->
	</context-param>

	<!--
		- Loads the root application context of this web app at startup,
		- by default from "/WEB-INF/applicationContext.xml".
		-
		- The root context is the parent of all servlet-specific contexts.
		- This means that its beans are automatically available in these child contexts,
		- both for getBean(name) calls and (external) bean references.
	-->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener
	</listener>

	<!--
		- Spring web MVC servlet that dispatches request to registered handlers.
		- Has its own application context, by default defined in "{servlet-name}-servlet.xml",
		- i.e. "image-servlet.xml" in this case.
		-
		- A web app can contain any number of such servlets.
		- Note that this web app has a shared root application context, serving as parent
		- of all DispatcherServlet contexts.
	-->
	<servlet>
		<servlet-name>image
		<servlet-class>org.springframework.web.servlet.DispatcherServlet
		<load-on-startup>2
	</servlet>

	<!--
		- Dispatcher servlet mapping for the web user interface,
		- refering to the "image" servlet above.
	-->
	<servlet-mapping>
		<servlet-name>image
		<url-pattern>/image/*
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp
	</welcome-file-list>

</web-app>

Other Spring Framework examples (source code examples)

Here is a short list of links related to this Spring Framework web.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.