this is how I intialize theme beans:
<bean id="themeSource"
class="org.springframework.ui.context.support.ResourceBundleThemeSource">
<property name="basenamePrefix" value="resources.theme-" />
</bean>
<bean id="themeChangeInterceptor"
class="org.springframework.web.servlet.theme.ThemeChangeInterceptor">
<property name="paramName" value="theme" />
</bean>
<bean id="themeResolver"
class="org.springframework.web.servlet.theme.CookieThemeResolver">
<property name="defaultThemeName" value="default" />
</bean>
<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<list>
<ref bean="localeChangeInterceptor" />
<ref bean="themeChangeInterceptor" />
</list>
</property>
</bean>
this is my folder stucture:

these are the inside of my 3 properties files:
css=themes/black.css
css=themes/blue.css
css=themes/default.css
I have also tried these:
- css=classpath:themes/default.css
- css=/themes/default.css
- css=./themes/default.css
Should the css even be in WEB-INF/classes. I’ve tried moving it out and in etc, but never quite seemed to get it to work.
Here is how I put it in my JSP:
<link rel="stylesheet" href="<spring:theme code='css'/>" type="text/css" />
This is now my output looks like:

This is part of JSP:
<span style="float: left">
<a href="?theme=default">def</a>
|
<a href="?theme=black">blk</a>
|
<a href="?theme=blue">blu</a>
</span>
This is my black.css.
body {
background-color: #888;
color: white;
}
My problem is, that the css never seems to go on my JSP file. This is probably caused because properties file can not find css file…
Feel free to ask further info.
What I needed to do here, was to move my resources(js or css files) to root folder of my project.
The second thing I could do instead, is to create a resource mapping for my css files.
Both would work, but I went with the first solution at the moment.