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

Spring Framework example source code file (common.xml)

This example Spring Framework source code file (common.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

default, default, doctype, exceptionhandler, message, propertyplaceholderconfigurer, public, resolver, spring//dtd, the, the, utf-8, utf-8, view

The Spring Framework common.xml source code

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">

<beans>

	<!-- The one and only PetService -->
	<bean id="petService" class="org.springframework.samples.petportal.service.PetServiceImpl">
		<property name="initPets" value="${pets.initPets}"/>
	</bean>
	
	<!-- enable access to externalized properties via PropertyPlaceholderConfigurer -->
	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location" value="WEB-INF/pets.properties"/>
	</bean>
	
	<!-- Message source for this context, loaded from localized "messages_xx" files -->
	<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
		<property name="basenames">
			<list>
				<value>messages
			</list>
		</property>										
	</bean>

	<!-- Default View Resolver -->
	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
		<property name="prefix" value="/WEB-INF/jsp/"/>
		<property name="suffix" value=".jsp"/>
	</bean>

	<!-- Default ExceptionHandler -->
	<bean id="defaultExceptionHandler" class="org.springframework.web.portlet.handler.SimpleMappingExceptionResolver">
    <property name="order" value="10"/>
		<property name="defaultErrorView" value="error"/>
		<property name="exceptionMappings">
			<props>
				<prop key="javax.portlet.PortletSecurityException">unauthorized
				<prop key="javax.portlet.UnavailableException">unavailable
			</props>
		</property>  
	</bean>

</beans>

Other Spring Framework examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 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.