dimanche 22 février 2015

Resource and properties file management issue

I am trying to learn spring. I have some trouble to manage my resource and properties file.


This is my mvc-dispatcher-servlet.xml file.



<beans xmlns="http://ift.tt/GArMu6"
xmlns:context="http://ift.tt/GArMu7"
xmlns:xsi="http://ift.tt/ra1lAU" xmlns:mvc="http://ift.tt/1bHqwjR"
xsi:schemaLocation="
http://ift.tt/GArMu6
http://ift.tt/1cnl1uo
http://ift.tt/1bHqwjR
http://ift.tt/1kF4x7W
http://ift.tt/GArMu7
http://ift.tt/1ldEMZY">

<context:component-scan base-package="com.test.common.controller" />

<bean
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="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="messages/messages">
</property>
</bean>

<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang">
</property>
</bean>

<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="tr">
</property>
</bean>

<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor"/>
</property>
</bean>

<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />
</beans>


And this is my file descriptor.


file descriptor


My problem is:


When I delete



<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />


from mvc-dispatcher-servlet.xml file header.css file caanot be loaded.


When I don't delete I am not be able to change the language. What should I do to solve this problem.


Thanks.


Aucun commentaire:

Enregistrer un commentaire