Results 1 to 3 of 3

Thread: themeChangeInterceptor does not work with <mvc:annotation-driven /> in spring mvc

  1. #1

    Post 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

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default

    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
  •