In my first post I introduced webwork, a nice MVC from OpenSymphony. It turns out that they have a few more projects worth looking at. SiteMesh is a very simple framework, yet very useful. Its purpose is to apply layout and decoration to a web application.
It works in a very simple way. SiteMesh is based on Servlet Filters and so it sits between the user's request and your web application. It is clearly separated from your web application, that isn't even aware it exists.
As your web application finishes a client's request, the resulting HTML is processed by SiteMesh. Custom layout and style is then applied, and finally the modified HTML is returned to the client's browser.
There are several situations that can take full advantage of this architecture:
- You may need to choose from different layouts based on user's preferences (SiteMesh can choose decorators based on cookies, for example).
- You can choose to have different style files applied, based on the user's browser or even language.
- You may simply want to try out a different look for your application, before you actually make the changes visible to everyone else (you can define a decorator to be applied based on a specified request parameter).
0 comentários:
Post a Comment