aspose file tools*
The moose likes Spring and the fly likes Spring 3 and Sitemesh integration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 3 and Sitemesh integration" Watch "Spring 3 and Sitemesh integration" New topic
Author

Spring 3 and Sitemesh integration

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1056
I got a basic sitemesh example working with no problem (http://www.jforeach.com/learn-sitemesh-in-30-minutes-or-less/96), however, when I try to integrate that example with a simple Spring MVC 3 application, it's like the sitemesh stops obeying what's in the CSS file.

The pages do get decorated, but there is no style applied (color, layout, etc.).

The style sheet is in /WEB-INF/styles/style.css and I've tried to refer to it mostly using the full path like this, but also the same way it worked before I tried to integrate Spring, etc.

Not sure what the problem is getting these two technologies to work together.

Would appreciate any replies or suggestions.

Thanks.

- mike
Santhosh Kumar
Greenhorn

Joined: Nov 15, 2006
Posts: 11
Hi mike

Did you find the answer?.I am also facing the same problem.Any help would be appreciated.


SCJP 5.0 - 84%<br />SCWCD 1.4 - 86%
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1056
Santhosh Kumar wrote:Hi mike

Did you find the answer?.I am also facing the same problem.Any help would be appreciated.



I believe you need to add this line to your Spring servlet.xml file:



Hope that helps.

-mike
dhoom dhoomm
Greenhorn

Joined: Sep 05, 2012
Posts: 2
i guess you cannot access files from /WEB-INF/styles/* through browser, images, css files, etc are accessed through the browser.
You can take a view (.jsp, etc) from there as they are not directly accessed by the browser, but by the servlet engine. you have to place all publicly access-able files outside, eg. /resources/
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

See the Spring documentation here:
http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/mvc.html#mvc-config-static-resources

You can serve static resources using the following



Resources that need to be accessed like this should not be in WEB-INF


[How To Ask Questions][Read before you PM me]
 
 
subject: Spring 3 and Sitemesh integration