Use SiteMesh to decorate multiple webapps
Did you know it's possible to decorate multiple webapps with the same SiteMesh decorator? I learned how to do this from the SiteMesh mailing list:
- Put sitemesh.jar in your container's classpath. You could put it into each webapp's WEB-INF/lib, but it looks like there's problems with that.
- Create and deploy a webapp that contains the common decorator.
- In each webapp's decorators.xml, add a "webapp" attribute to point to the webapp you deployed in Step 2.
<decorators> <!-- load decorator from a different web-app deployed in the server --> <decorator name="main" webapp="some-other-webapp" page="/decorators/main.jsp"> <pattern>/*</pattern> </decorator> </decorators>
Try to do *that* with Tiles.
Posted by Patrick Peak on April 12, 2005 at 05:13 PM MDT #
Posted by analogueboy on April 12, 2005 at 05:26 PM MDT #
I'm just trying to give SiteMesh the credit it deserves. Ever since I switched from Tiles to SiteMesh, I've had no reason to go back. I guess that means I don't have much of a need for page composition in the applications I develop.
Posted by Matt Raible on April 12, 2005 at 05:38 PM MDT #
I have a problem with struts + sitemesh + velocity. Struts Velocity tools doesn't work when I try to use it with sitemesh. This is my web.xml.
Posted by arek on April 12, 2005 at 09:07 PM MDT #
Posted by Aditya on April 13, 2005 at 12:13 AM MDT #
Posted by Dan Campers on April 13, 2005 at 01:25 AM MDT #
Posted by Matt Raible on April 13, 2005 at 06:08 PM MDT #
Splitting your website up into multiple web apps gives you finer grained control over re-deployment. (Why re-deploy your entire website for a little change in one subsection?) And SiteMesh still allows you to retain a consistent look and feel for the whole, in the one place.
Posted by Steve Eynon on April 14, 2005 at 02:54 PM MDT #
Posted by Tim on April 21, 2005 at 08:34 PM MDT #
Posted by Guava on April 26, 2005 at 02:10 AM MDT #
will so many filters affect the speed of a website?
Posted by 202.237.165.249 on February 03, 2006 at 07:03 AM MST #
is the web.xml config and the decorator.jsp is as follows
and i have separate mainWebapp-servlet.xml and webapp2-sevlet.xml. The dispatcher servlet dispatches correctly and also the decoration is applied properly. But the problem is when you want to exclude the decoration for ajax request, by changing pattern ** to someUrl.* it does not pick up correctly.. i have tried all option like **/webapp2/someUrl.*, **/someUrl.*, **someUrl.*, /someUrl.* for all the any above specific url it is not working..
Any body can explain what may be the problem, that will be great help. thanking you..
Posted by Rakshith Begane on January 28, 2009 at 05:16 AM MST #