chelya
Apr 28th, 2006, 11:01 PM
themes work fine when used in jsp views. However when I attempt to do the same thing in sitemesh decorator (loaded before request gets to the DispatcherServlet) it fails to lacate theme property file and resolve the value.
I have theme beans defined in app-servlet.xml
<bean id="themeSource" class="org.springframework.ui.context.support.ResourceBun dleThemeSource">
<property name="basenamePrefix">
<value>foo.bar.</value>
</property>
</bean>
<bean id="themeResolver" class="org.springframework.web.servlet.theme.FixedThemeRe solver">
<property name="defaultThemeName">
<value>mytheme</value>
</property>
</bean>
Logs tell an interesting story:
<load all applicationContext-*.xml>
...
INFO org.springframework.ui.context.support.UiApplicati onContextUtils.initThemeSource(83) - Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBun dleThemeSource@1202d69]
...
<load app-servlet.xml>
...
INFO org.springframework.ui.context.support.UiApplicati onContextUtils.initThemeSource(67) - Using ThemeSource [org.springframework.ui.context.support.ResourceBun dleThemeSource@e31e33]
INFO org.springframework.web.servlet.DispatcherServlet. initThemeResolver(435) - Using ThemeResolver [org.springframework.web.servlet.theme.FixedThemeRe solver@11abd68]
Somehow themeSource is attempted to be initialized twice, but themeResolver is only initialized once.
Thoughts?
I have theme beans defined in app-servlet.xml
<bean id="themeSource" class="org.springframework.ui.context.support.ResourceBun dleThemeSource">
<property name="basenamePrefix">
<value>foo.bar.</value>
</property>
</bean>
<bean id="themeResolver" class="org.springframework.web.servlet.theme.FixedThemeRe solver">
<property name="defaultThemeName">
<value>mytheme</value>
</property>
</bean>
Logs tell an interesting story:
<load all applicationContext-*.xml>
...
INFO org.springframework.ui.context.support.UiApplicati onContextUtils.initThemeSource(83) - Unable to locate ThemeSource with name 'themeSource': using default [org.springframework.ui.context.support.ResourceBun dleThemeSource@1202d69]
...
<load app-servlet.xml>
...
INFO org.springframework.ui.context.support.UiApplicati onContextUtils.initThemeSource(67) - Using ThemeSource [org.springframework.ui.context.support.ResourceBun dleThemeSource@e31e33]
INFO org.springframework.web.servlet.DispatcherServlet. initThemeResolver(435) - Using ThemeResolver [org.springframework.web.servlet.theme.FixedThemeRe solver@11abd68]
Somehow themeSource is attempted to be initialized twice, but themeResolver is only initialized once.
Thoughts?