Spring Framework mvc-dispatcher-servlet.xml


      Click here to attend Spring Framework 4.x and certification course with a discount

 
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 	
	xmlns:context="http://www.springframework.org/schema/context"	
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:util="http://www.springframework.org/schema/util"  
	xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        http://www.springframework.org/schema/util 
        http://www.springframework.org/schema/util/spring-util-3.0.xsd"
        >  
 
	<context:component-scan base-package="nl.kameroom.controller" />
	  
	<mvc:annotation-driven />
	
	<mvc:view-controller path="/index.html" view-name="index"/>
	<mvc:view-controller path="/index.k" view-name="index"/>
    <mvc:view-controller path="/login.k" view-name="login/login"/>	
	<mvc:view-controller path="/forgotpass.k" view-name="login/forgotpass"/>
	<mvc:view-controller path="/contact.k" view-name="contact/contact"/>
    <mvc:view-controller path="/conditions.k" view-name="conditions/termsandconditions"/>
    <mvc:view-controller path="/about.k" view-name="about/about"/>
    <mvc:view-controller path="/privacy.k" view-name="privacy/privacy"/>
    <mvc:view-controller path="/help.k" view-name="help/help"/>
    <mvc:view-controller path="/profile/changepass.k" view-name="profile/changepass"/>
    <mvc:view-controller path="/searchroom.k" view-name="search/searchroom"/>
    <mvc:view-controller path="/searchtenant.k" view-name="search/searchtenant"/>
    <mvc:view-controller path="/adverts.k" view-name="advert/advertselection"/>
    <mvc:view-controller path="/search.k" view-name="search/searchselection"/>
    <mvc:view-controller path="/roomadvert.k" view-name="advert/roomadvert"/>
    <mvc:view-controller path="/roomwanted.k" view-name="advert/roomwanted"/>
    <mvc:view-controller path="/messages.k" view-name="message/messagesgrid"/>
    <mvc:view-controller path="/profile/tenantmessage.k" view-name="message/tenantmessage"/>
    <mvc:view-controller path="/profile/roommessage.k" view-name="message/roommessage"/>
    
    <mvc:interceptors>    
    <bean id="localeChangeInterceptor"
		class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
		<property name="paramName" value="language" />
	</bean>
	</mvc:interceptors>
	
	<bean id="localeResolver"
		class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
		<property name="defaultLocale" value="en" />
		<!--<property name="defaultLocale" value="nl_NL" />-->
		<property name="cookieMaxAge" value="1209600"/> 
	</bean>
 	
 	 <!--Application Message Bundles-->
	<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
		<property name="basename" value="/WEB-INF/langmessages/lang" />
		<property name="cacheSeconds" value="120" />
	</bean> 
	
 	<bean id="localeMessageSource"
		class="nl.kameroom.util.LocaleMessageSource">
		<property name="messageSource" ref="messageSource" />
		<property name="localeResolver" ref="localeResolver" />
	</bean>
		
	
 	<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
    	<property name="resourceLoaderPath"><value>/WEB-INF/pages/email</value></property>
    </bean>
	
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		 <!--<property name="maxUploadSize" value="2000000"/>  -->
	</bean>
	
	<bean id="viewResolver"
    	class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
        <property name="prefix">
            <value>/WEB-INF/pages/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
	
	<bean id="handlerExceptionResolver" class="nl.kameroom.util.ExceptionHandler" />
		
	<util:properties id="settings" location="/WEB-INF/classes/nl/kameroom/util/site.properties" />  
</beans>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s