Thursday, 15 July 2010

java - css file is not working in Spring Theme module. properties files are loaded properly but css are not working -


I have configured my configuration file ie Dispatcher-servlet.xml file for themes using the following beans < / P>

  & lt; Bean id = "theme resource" category = "org.springframework.ui.context.support.ResourceBundleThemeSource" & gt; & Lt; Property Name = "BaseNamePrint" value = "Theme-" /> & Lt; / Bean & gt; & Lt ;! - Change Theme Interceptor and Resolver Definition - & gt; & Lt; Bean id = "Theme Change Interactive" class = "org.springframework.web.servlet.theme.ThemeChangeInterceptor" & gt; & Lt; Property name = "nickname" value = "theme" /> & Lt; / Bean & gt; & Lt; Bean id = "thumbnailer" class = "org.springframework.web.servlet.theme.ookieThemeResolver" & gt; & Lt; Property Name = "defaultThemeName" value = "Default" /> & Lt; / Bean & gt;   

I have added 3 properties under the theme- Black.proports, Theme- Blue.Properties, Theme- Default.properties under the source directory.

In each attribute file I added the key-value pair as the following

  style = style / blue.css style = style / black.css style = style / Default.css   

I put style folder under web content problem bundle this resourceTheme resources have been successfully loaded but could not be able to load css files.

I have added the follwing code to the JSP file

  & lt; Link rel = "stylesheet" Href = "& lt; spring: theme code = 'style' / & gt; Type = "text / css" />   

to change

  & lt; Span style = "float: right;" & Gt; & Lt; A href = "theme = default" & gt; Default & lt; / A & gt; & Amp; Nbsp; | & Lt; A href = "theme = blue" & gt; Blue & lt; / A & gt; & Amp; Nbsp; | & Lt; A href = "topic = black" & gt; Black & lt; / A & gt; & Lt; / Span & gt;   

Please tell me if there is a problem ........ please kindly & gt; Thank you in advance

I do not have the experience of spring theme support, though I have some mistake in your URL .

Your URL is relative first. You should always have full URL (start with / )

Second, while using any URL, Code> & lt; C: url & gt; or & lt; Spring: URL & gt; should be used so that the correct reference prefix is ​​used:

  & lt; Spring: url var = "cssUrl" & gt; & Lt; Jsp: attribute name = "value" & gt; & Lt; Spring: Theme code = "style" /> & Lt; / Jsp: attribute & gt; & Lt; / Spring: URL & gt;    

No comments:

Post a Comment