Announcement Announcement Module
Collapse
No announcement yet.
ThemeChangeInterceptor not getting called Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ThemeChangeInterceptor not getting called

    Hi there,

    straigt to the problem:

    We were using spring 2.5 and now upgrading to 3.0.5.

    We were using the theming of Spring WebMVC.

    After the switch, the interceptor won't work anymore, though the standard theme always works. We simply cannot change the theme by setting the parameter theme_mode=xyz

    Here's our config file:

    Code:
    <bean id="themeChangeInterceptor" class="org.springframework.web.servlet.theme.ThemeChangeInterceptor">
    		<property name="paramName" value="theme_mode"></property>
    	</bean>
    	
    	<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    		<property name="interceptors">
    			<list>
    				<ref bean="themeChangeInterceptor"/>
    			</list>
    		</property>
    	</bean>
    
    <bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource">
    		<property name="basenamePrefix" value="com.sbxmgmt.vevention.themes."/>
    	</bean>
    		
    	<bean id="themeResolver" class="org.springframework.web.servlet.theme.SessionThemeResolver">
    		<property name="defaultThemeName" value="theme"/>
    		
    	</bean>
    It won't get into my brain why this doesn't work. As I can see it is exactly the same as the well known tutorial on http://viralpatel.net/blogs/2010/10/...l-example.html

    In dispatcerservlet where the interceptors are invoked, the interceptors never "arrive", meaning, the interceptor is not in the list, though it is getting set in AbstractHandlerMapping.

    I appreciate any help!

    Thanks,

    Hamb

  • #2
    Hi Folks,

    a programmer found out how to solive this:

    Just replace one line with:

    <property name="order"><value>-1</value></property>

    The problem ist that the framework kicks off two Instances of DefaultAnnotationHandlerMapping.

    I attached the screenshot... the first one has now interceptors, the second one the right one.

    After we set the order to a lower value than 0 it works.

    Why are there two instances? Shouldn't be there just one single bean?

    Thanks ion advance,

    Hamb

    Comment


    • #3
      Hi Hamb, could you explain it to more how you solved it ,please? I can not see the images clearly( low resulation problem).
      I have exactly the same problem here.
      Thanks
      sumncc

      Comment

      Working...
      X