关于Spring主题的使用心得

刚才把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">
           <value>messages</value>
       </property>
    </bean>

那个messages对应一个文件,我这里为了省事用的messages_zh_CN.properties

在文件中加了这么一句image=http://localhost:8080/JSTLProject/image/070226.jpg对应一个image图片然后在jsp页面这样写

<table background="<spring:theme code="image"/>">

这个image会去找资源文件中的image然后找到相应的图片显示出来

 

 关于Spring主题的使用心得关于Spring主题的使用心得关于Spring主题的使用心得










本文转自 tony_action 51CTO博客,原文链接:http://blog.51cto.com/tonyaction/42038,如需转载请自行联系原作者