• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Spring 3 and Sitemesh integration

 
Bartender
Posts: 1938
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi mike

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

 
Mike London
Bartender
Posts: 1938
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic