Questions tagged [sitemesh]

SiteMesh is a Java web application development framework developed by OpenSymphony.

According to OpenSymphony, SiteMesh:

  • Is a web-page layout and decoration framework and web application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required
  • Intercepts requests to any static or dynamically generated HTML page requested through the web server, parses the page, obtains properties and data from content, and generates appropriate final page with modifications to original—based on Decorator design pattern
  • Can also include entire HTML pages as a Panel within another page—similar to Server Side Includes, except HTML document modified to create a visual window (using document's Meta-data as aid) within a page. Using this feature, Portal type web sites can be built very quickly and effectively. This is based upon the well-known Composite design pattern.
  • Built on Java 2 with Servlet, JSP and XML technologies. This makes it good for use with Java EE applications, however it can be integrated with non-Java server-side web architectures, like CGI (Perl/Python/C/C++/etc), PHP, and ColdFusion.
  • Very extensible, designed for easy extension for custom needs

History

SiteMesh was originally developed in 1999 by Joe Walnes. At the time it used Servlet Chains, a feature not part of the standard Servlet specification but supported by some Servlet containers such as Orion Application Server. In 2000, the first public review of version 2.3 of the Servlet Specification was released, which contained the addition of Servlet Filters. These provided a standardized alternatives to Servlet Chains and SiteMesh was adapted to make use of these instead. Shortly after this, the decision was made to release SiteMesh as open source software. Joe Walnes and Mike Cannon-Brookes formed the OpenSymphony project to provide a source of Java EE components - the first two consisting of SiteMesh and OSCache. At this time, SiteMesh had a very small set of users, many of whom got involved in the development of the project. Not long after SiteMesh was originally open sourced, Victor Salaman rewrote the internal HTML parser to produce a 1200% performance increase.

Sources:

http://en.wikipedia.org/wiki/SiteMesh

http://www.opensymphony.com/sitemesh/

Documentation

240 questions
2
votes
2 answers

SiteMesh: Changing the content-type of the response

I'm trying to persuade a SiteMesh decorator to change the content-type of the response, but no joy. The content-type always ends up being the same as the decorated JSP, rather than that of the decorator. For example, say I have a JSP with the…
skaffman
  • 398,947
  • 96
  • 818
  • 769
2
votes
1 answer

WebJars doesn't work with Tomcat7 + SpringMVC + Sitemesh3

I'm trying to make my application works with WebJars running on Tomcat7 but the CSS/JS files aren't found by my HTML pages. I already change the web.xml to v3.0 and the facets of the project too (inside Eclipse). Also checked the web.xml from tge…
Pmt
  • 1,122
  • 3
  • 13
  • 27
2
votes
1 answer

custom body class from siteMash in grails

I have some issue on grails siteMash issue.i need custom class define in every GSP page when i call but in my layout page i am having only instance of all class.so every page i will change as i need.But i tried pageProperties that not work may be i…
2
votes
2 answers

conditional check in grails site mesh

I have my gsp pages all applying the layout from main.gsp. Main.gsp is using the bootstrap layout and a container to make the pages responsive. In a few of the pages on my site I'm trying to use a liquid layout and don't want to have a container…
spock99
  • 1,182
  • 1
  • 10
  • 32
2
votes
2 answers

Anyone have good complete examples of using sitemesh and layouts in Grails 1.2?

I had a grails 1.1 app working where keyword and description meta tags were dynamically generated. There was a change in how that works in 1.2, but I cannot found good documentation. I've tried numerous ways to make it work. No matter what I do…
Andrew
  • 2,355
  • 4
  • 29
  • 42
2
votes
1 answer

Custom Error Page Not Decorated by Sitemesh in Spring Security Application

In a Spring MVC (3.2.4) application with Spring Security (3.2.0.RC2) with Sitemesh (2.4.2), the web.xml file has this entry: 403 /error?code=403 which maps to…
Paul Croarkin
  • 14,496
  • 14
  • 79
  • 118
2
votes
0 answers

Sharing Sitemesh decorator between apps?

In order to adhere to the DRY principle and allow the look and feel of applications to change across my organization without significant redeploys, I would like to share Sitemesh decorators across Java webapps deployed to various app containers. Is…
smp7d
  • 4,947
  • 2
  • 26
  • 48
2
votes
1 answer

Sitemesh spring mvc access to the resources in decorator

I have a problem with import css files in decorator.jsp file. My files structure looks following: WEB-INF css style.css decorators decorator.jsp How can I access style.css? I tried with different combinations an still didn't…
luke
  • 3,531
  • 1
  • 26
  • 46
2
votes
2 answers

SpringMVC 3 405 - Request method 'POST' not supported

Controller @Controller public class Tester { @RequestMapping(value="testPost", method = RequestMethod.POST) public ModelAndView testPost(){ ModelAndView _mv = new ModelAndView(); _mv.setViewName("shared/post"); return _mv; …
Shore
  • 123
  • 2
  • 10
2
votes
1 answer

Sitemesh 3. Output all body tag attributes to the layout

I have a page with: and a sitemesh layout with body: Is there a way to make the attributes of the body…
mjs
  • 21,431
  • 31
  • 118
  • 200
2
votes
1 answer

Sitemesh does not decorate returned views

I have tried to set up a simple sitemesh decorated page, but am running into a wall now. First, my setup: #decorators.xml
ximarin
  • 401
  • 3
  • 14
1
vote
1 answer

Spring MVC interceptor vs Sitemesh

In a Spring MVC application using Sitemesh to decorate my views, I want to inject into every Model a security attribute called sec of type WebSecurityExpressionRoot. This way I could call hasAnyRole(), hasAuthority()... in all my views so…
sylvain
  • 246
  • 2
  • 5
1
vote
1 answer

java.lang.NoClassDefFoundError: javax/servlet/Filter : How to use sitemesh 2.4 with spring 6

Recently, I have upgraded my application library to use spring 6, tomcat 10. But some of the library still using the old ones like sitemesh. When running application, i got error the java.lang.NoClassDefFoundError: javax/servlet/Filter. Since tomcat…
1
vote
1 answer

Sitemesh 2.4 with GAE

I'm trying to use sitemesh2.4 for my GAE(struts 1.3, spring 2.5) based app. I found out a couple of tutorials to configure sitemesh. I did exactly the same. web.xml sitemesh
Shwetanka
  • 4,976
  • 11
  • 44
  • 68
1
vote
1 answer

siteMesh + Spring 3.0 + Exclude pattern

I would like to have all the requests decorated except my welcome page. This is the default page I display when only my application context is in the url with no other path elements. http://hostname:8080/MyApp/ -> This should not be decorated. This…
Chandra
  • 1,577
  • 3
  • 21
  • 28