-
May 15th, 2012, 01:22 PM
#1
themeChangeInterceptor does not work with <mvc:annotation-driven /> in spring mvc
Hi ,
I am New to spring and Spring MVC .I am trying to develop a sipme Web app where user can add update and delete contacts.
i was trying to use theme on one Page,but i am facing some issues.
My page has 3 links Default,black and blue and depending upon the link user clicks bgcolor should change.
its loading the default theme but not loading theme on change of theme.
I have attached the files and read me file .
I am using STS IDE.
Thanks,
Neeraj
-
May 15th, 2012, 02:49 PM
#2
This question has been answered before.
You are using the mvc namespace to configure spring mvc and as such you also have to use the namespace to configure the interceptor. How to do that is explained in the reference guide.
-
May 15th, 2012, 04:39 PM
#3
Hi Marten,
I hope you are doing good.
Thanks for your reply.
i removed the following entry from mvc-dispatcher-servlet.xml
***********************************************
<!--
<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotat ion.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<list>
<ref bean="themeChangeInterceptor" />
</list>
</property>
</bean>
-->
***********************************************
i added the following entry in mvc-dispatcher-servlet.xml
Added :
***********************************************
<mvc:interceptors>
<bean id="themeChangeInterceptor" class="org.springframework.web.servlet.theme.Theme ChangeInterceptor">
<property name="paramName" value="theme" />
</bean>
</mvc:interceptors>
***********************************************
It worked.thanks again.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules