SiteMesh is a web-page layout and decoration framework which competes with packages such as Struts-Tiles, and hand coding :) SiteMesh is one of those applications that many people always carry in their toolbox, yet isn't talked about much. Advanced SiteMesh delves into a case study of using the framework.
Read: Advanced SiteMesh
Visit: SiteMesh's home page
-
SiteMesh: Learning all of the features of SiteMesh (15 messages)
- Posted by: Dion Almaer
- Posted on: September 23 2004 17:59 EDT
Threaded Messages (15)
- SiteMesh: Learning all of the features of SiteMesh by Ian Pojman on September 24 2004 11:04 EDT
- SiteMesh: Learning all of the features of SiteMesh by Konstantin Ignatyev on September 24 2004 11:24 EDT
- SiteMesh: Learning all of the features of SiteMesh by Andrea Chiodoni on October 17 2004 05:36 EDT
- JSP 2.0 by Karmen Blake on September 24 2004 11:50 EDT
- JSP 2.0 by Konstantin Ignatyev on September 24 2004 19:36 EDT
- JSP 2.0 by Jason Carreira on September 26 2004 00:21 EDT
-
JSP 2.0 by Aapo Laakkonen on September 27 2004 09:51 EDT
-
re: JSP 2.0 by Serg Koval on September 27 2004 04:50 EDT
-
re: JSP 2.0 by Aapo Laakkonen on September 28 2004 08:23 EDT
-
re: JSP 2.0 by Dorel Vaida on September 29 2004 03:00 EDT
-
re: JSP 2.0 by Aapo Laakkonen on September 29 2004 09:34 EDT
- PHP version of SiteMesh by Matt Walker on March 09 2010 07:52 EST
-
re: JSP 2.0 by Aapo Laakkonen on September 29 2004 09:34 EDT
-
re: JSP 2.0 by graham o'regan on September 29 2004 03:57 EDT
- re: JSP 2.0 by Aapo Laakkonen on September 29 2004 09:24 EDT
-
re: JSP 2.0 by Dorel Vaida on September 29 2004 03:00 EDT
-
re: JSP 2.0 by Aapo Laakkonen on September 28 2004 08:23 EDT
-
re: JSP 2.0 by Serg Koval on September 27 2004 04:50 EDT
-
JSP 2.0 by Aapo Laakkonen on September 27 2004 09:51 EDT
- SiteMesh: Learning all of the features of SiteMesh by Andrew Clifford on September 26 2004 17:23 EDT
-
SiteMesh: Learning all of the features of SiteMesh[ Go to top ]
- Posted by: Ian Pojman
- Posted on: September 24 2004 11:04 EDT
- in response to Dion Almaer
sitemesh competes with tiles? that's a new one... -
SiteMesh: Learning all of the features of SiteMesh[ Go to top ]
- Posted by: Konstantin Ignatyev
- Posted on: September 24 2004 11:24 EDT
- in response to Ian Pojman
sitemesh competes with tiles? that's a new one...
And pretty successfully in many cases!
SiteMesh is really wonderful piece of software.
Couple detail to watch out:
- when used with Struts and do prefixed mapping like /do/yourAction, and you need more than one path based mappers consider this bug and a workaround: http://jira.opensymphony.com/browse/SIM-127
- if a common element (menu for instance) is a .jsp and has dynamic elements (like counter) and you display static html page, then in Tomcat you will get page from browser cache because Tomcats default html file handler sends back not-changed code and browser uses cache. As a workaround simple NonCachingHtmlHandler can be used:
<servlet>
<servlet-name>html</servlet-name>
<servlet-class>xxx.NoCacheHTMLServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>html</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping> -
SiteMesh: Learning all of the features of SiteMesh[ Go to top ]
- Posted by: Andrea Chiodoni
- Posted on: October 17 2004 05:36 EDT
- in response to Ian Pojman
Hi, I'm new to SiteMesh. Let's say a piece (comming from another web-server/application) of the decorated page contains a link which is relative to it's original context. Can be handled with SiteMesh? -
JSP 2.0[ Go to top ]
- Posted by: Karmen Blake
- Posted on: September 24 2004 11:50 EDT
- in response to Dion Almaer
How would sitemesh compare to using JSP tag files for headers, footers, etc.? -
JSP 2.0[ Go to top ]
- Posted by: Konstantin Ignatyev
- Posted on: September 24 2004 19:36 EDT
- in response to Karmen Blake
How would sitemesh compare to using JSP tag files for headers, footers, etc.?
Simply eliminates need for those tags. -
JSP 2.0[ Go to top ]
- Posted by: Jason Carreira
- Posted on: September 26 2004 00:21 EDT
- in response to Karmen Blake
How would sitemesh compare to using JSP tag files for headers, footers, etc.?
Rather than having to hard-code in the headers and footers to include, with Sitemesh you declaratively tell it which decorators to apply without the page being decorated having to know anything about it. Thus it can decorate static pages, CGI, PHP, etc. in addition to Servlet and JSP output. -
JSP 2.0[ Go to top ]
- Posted by: Aapo Laakkonen
- Posted on: September 27 2004 09:51 EDT
- in response to Jason Carreira
Thus it can decorate static pages, CGI, PHP, etc. in addition to Servlet and JSP output.
Yeah, but tell me who does run servlet engine in front of a web server eg. apache. Usually it's the other way around. -
re: JSP 2.0[ Go to top ]
- Posted by: Serg Koval
- Posted on: September 27 2004 16:50 EDT
- in response to Aapo Laakkonen
You don't need to run servlet engine in front of web server.
You did not understand the idea. -
re: JSP 2.0[ Go to top ]
- Posted by: Aapo Laakkonen
- Posted on: September 28 2004 08:23 EDT
- in response to Serg Koval
You don't need to run servlet engine in front of web server.You did not understand the idea.
I think I did. Propably you didn't. SiteMesh is written using Servlet Filters. Can you please tell me how can you decorate anything without Servlet Engine? If I have for example Apache and mod_php and I have this web server running in front of servlet engine, how I can then decorate my PHP pages (that are generated on web server with mod_php)? That just doesn't work, period. Propably I could run some java code through CGI to emulate filters, but don't say that this is the idea. And yes, I have used SiteMesh and I have even used it in servlet engine that was running behinf a webserver. -
re: JSP 2.0[ Go to top ]
- Posted by: Dorel Vaida
- Posted on: September 29 2004 03:00 EDT
- in response to Aapo Laakkonen
I would say that you can use sitemesh in the scenario you are talking about by configuring the front http server to forward all the requests to the 'sitemeshed' servlet engine (and not to dispatch the php requesst directly to the mod_php), and than sitemesh will decorate the output of the php page with whatever you have set up in the decorators.xml ... It is just a supposition, I don't know how if it is practically possible since the php requests should finally processed by modphp which would mean that you are going back to the front http server or that the php app is installed on another http server (e.g. the same machine on another port). I don't know, it sounds weird but I think I could do that.You don't need to run servlet engine in front of web server.You did not understand the idea.
I think I did. Propably you didn't. SiteMesh is written using Servlet Filters. Can you please tell me how can you decorate anything without Servlet Engine? If I have for example Apache and mod_php and I have this web server running in front of servlet engine, how I can then decorate my PHP pages (that are generated on web server with mod_php)? That just doesn't work, period. Propably I could run some java code through CGI to emulate filters, but don't say that this is the idea. And yes, I have used SiteMesh and I have even used it in servlet engine that was running behinf a webserver.
In the sitemesh vs tiles comparison ... I think there can't be any comparison. Tiles is a usual piece of software with all limitations imposed by usual design and Sitemesh is a wonder of thechnology with all 'problems' imposed by revolutionary design :-). Meaning it allows you to do too much with it and that is allwais a danger. (One guy said once that the power of a framework stands in what it DOESN'T alow you to do :-)) -
re: JSP 2.0[ Go to top ]
- Posted by: Aapo Laakkonen
- Posted on: September 29 2004 09:34 EDT
- in response to Dorel Vaida
I don't know how if it is practically possible since the php requests should finally processed by modphp which would mean that you are going back to the front http server or that the php app is installed on another http server (e.g. the same machine on another port). I don't know, it sounds weird but I think I could do that.
Yes, my point is that is not practical. SiteMesh developers/users seem to emphatize that you can use SiteMesh with another server side technologies, but they do not say how to do it or if it's practical or not. In my opinion it's not practical to use SiteMesh with other technologies than Java.
I was in a need for sitemesh like decorating system for my PHP pages. What I did, I first checked out PHP implementation of SiteMesh, but I was not all that happy with it. I decided to write my own and it turned out to be 50 lines of PHP code, with every important feature implemented that are in SiteMesh. I mainly just used PHP's output buffering and regular expressions. -
PHP version of SiteMesh[ Go to top ]
- Posted by: Matt Walker
- Posted on: March 09 2010 07:52 EST
- in response to Aapo Laakkonen
Hi Aapo, Are you looking to release your PHP implementation of SiteMesh? Matt. -
re: JSP 2.0[ Go to top ]
- Posted by: graham o'regan
- Posted on: September 29 2004 03:57 EDT
- in response to Aapo Laakkonen
-
re: JSP 2.0[ Go to top ]
- Posted by: Aapo Laakkonen
- Posted on: September 29 2004 09:24 EDT
- in response to graham o'regan
Heres a a way of doing it ;) PHP and Tomcat - Perfect bed-fellows?
PHP's Servlet Wrapper is pure shit compared to mod_php and Apache integration. So, your suggestion is possible, but not very practical. -
SiteMesh: Learning all of the features of SiteMesh[ Go to top ]
- Posted by: Andrew Clifford
- Posted on: September 26 2004 17:23 EDT
- in response to Dion Almaer
I would think that Sitemesh and Tiles will compete more and more with Portal frameworks and the JSR-168 and WSRP specs. In essence the specs decouple look and fell and layout from function.