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
40
votes
4 answers

Are there any good tutorials for using sitemesh in a grails application?

I'm a pretty experienced Grails developer, but most of my experience has been with using grails for serving up JSON/XML to a flex app and some relatively simple HTML websites. I've been diving deeper into using the sitemesh integration in grails and…
Ted Naleid
  • 26,511
  • 10
  • 70
  • 81
35
votes
7 answers

How to avoid using scriptlets in my JSP page?

I've been told that the use of scriptlets (<%= ... %>) in my JSP pages isn't such a great idea. Can someone with a bit more java/jsp experience please give me some pointers as to how to change this code so its more 'best practice', whatever that may…
Chris
  • 39,719
  • 45
  • 189
  • 235
25
votes
7 answers

In a grails gsp template, how can I use a server side comment without sitemesh throwing an error?

When I use a standard jsp comment block in a gsp template <%-- some server-side comment --%> , sitemesh throws an 'unexpected token' error. Is there another comment syntax I can use?
gabe
  • 1,127
  • 1
  • 11
  • 23
12
votes
2 answers

Apache Tiles retired. Alternatives?

Apache Tiles moved into the Attic in December 2018. So Apache Tiles has retired. I'm using Spring MVC framework and JSP. What alternatives are there? I saw Sitemesh, but it is a decorator and I need a template framework. I want to maintain my tiles…
11
votes
3 answers

SiteMesh - still active? v2 vs v3?

I'm evaluating SiteMesh for use in our web applications. I've found two websites for SiteMesh version 2.4 (Jan 2009) -> http://www.opensymphony.com/sitemesh/ version 3.0 (Sep 2009) -> http://www.sitemesh.org/ Looks like the same author is involved…
subcontact
  • 201
  • 1
  • 5
9
votes
4 answers

Best practices for sharing web-tier code (Controllers and JSPs) between similar web apps

I'm working on rewriting some aging web applications. There are two in particular that are very, very similar, yet share no code today and I aim to fix that. The projects are being rewritten with Maven, Spring MVC, and Sitemesh. Model tier code is…
KevinF
  • 133
  • 1
  • 8
9
votes
2 answers

Is it possible to decorate more than once in Sitemesh?

I'm trying to do something like this: For all the requests to /admin/* I need the page to be decorated using the B decorator but also that B decorator has to be included in the content of A decorator which is main application layout. How can I do…
Alfredo Osorio
  • 11,297
  • 12
  • 56
  • 84
9
votes
2 answers

Sitemesh or Tiles

Working on the design of a web-application and since it will be a large application so can not reply on jsp include feature so have to use some other solution and for that we came up with Tiles and Sitemesh. We are new to both of them so any insight…
Umesh Awasthi
  • 23,407
  • 37
  • 132
  • 204
8
votes
1 answer

Spring Session not working with Sitemesh

I'm working on implementing Spring Session in a legacy application. I followed the Spring documentation to get the session library implemented and everything seems to be working well, except.... There is a UI element that is decorated on every page…
user1521567
  • 1,743
  • 3
  • 21
  • 31
8
votes
4 answers

How to obtain model attribute or spring's bean in sitemesh decorator?

I am using Spring 3 with sitemesh. I would like to refer to spring context bean in decorator page defined in sitemesh. The problem is that SiteMesh filter is working outside the Spring context, so request object on sitemesh decorator jsp page is…
glaz666
  • 8,707
  • 19
  • 56
  • 75
7
votes
0 answers

Grails Nested Layouts

I am new to Grails/GSP/Sitemesh and am trying to figure out if I can use nested layouts. I would like to have a main layout that will be used for all of my pages to contain a standard header, footer, and all my CSS/JavaScript resources. On another…
Michael
  • 2,460
  • 3
  • 27
  • 47
6
votes
3 answers

Importing spring.ftl using Spring MVC, Sitemesh, Freemarker

How can I import the spring.ftl macros into a Freemarker template page using Spring MVC, Sitemesh, and Freemarker? I've configured a Spring MVC app using Sitemesh and Freemarker based on Ted Young's configuration example. According to the Spring…
Jason Stonebraker
  • 809
  • 1
  • 10
  • 11
6
votes
1 answer

Spring security tags in sitemesh decorator

I want to use a few tags of the spring security tag library inside the decorator file of site-mesh. However content inside these tags is never shown. Can anyone tell me why this is? Code:
Mark Baijens
  • 13,028
  • 11
  • 47
  • 73
6
votes
1 answer

Use of Sitemesh in Grails 3

I'm migrating a set of grails 2.0.4 applications to version 3.x. All of them are deployed in the same server together with a number of java applications. Both sets of java and grails applications have a common look and feel using sitemesh and…
Juan López
  • 183
  • 8
5
votes
1 answer

JSP, Sitemesh and Tiles hardcore - any alternatives?

Tiles and Sitemesh look quite popular but this stuff is really old and look terrible compared to current awesome stuff from e.g. Ruby (ERB) or PHP (Open Power Template). These days template engines allow comfortable templating (inserting variables,…
Nowaker
  • 12,154
  • 4
  • 56
  • 62
1
2 3
15 16