刚才把Spring的主题给研究出来了如果想用Spring的主题功能需要配置这些东西
<bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource"/>
<bean id="themeResolver" class="org.springframework.web.servlet.theme.FixedThemeResolver">
<property name="defaultThemeName">
那个messages对应一个文件,我这里为了省事用的messages_zh_CN.properties
在文件中加了这么一句image=http://localhost:8080/JSTLProject/image/070226.jpg对应一个image图片然后在jsp页面这样写
<table background="<spring:theme code="image"/>">
这个image会去找资源文件中的image然后找到相应的图片显示出来
![](http://img64.pp.sohu.com/images/blog/2007/2/28/16/10/1119e052dc2.jpg)
![](http://img114.pp.sohu.com/images/blog/2007/2/28/16/11/1119e09bce3.jpg)
![](http://img114.pp.sohu.com/images/blog/2007/2/28/16/11/1119e0a1271.jpg)
本文转自 tony_action 51CTO博客,原文链接:http://blog.51cto.com/tonyaction/42038,如需转载请自行联系原作者