ASP.NET Master Pages equivalent in Java?

First, the equivalent of ASP. Net in Java is going to be a web framework, such as the ones you mention (Tiles, Tapestry and Velocity).

First, the equivalent of ASP. Net in Java is going to be a web framework, such as the ones you mention (Tiles, Tapestry and Velocity). Master pages give the ability to define pages in terms of content slotted into a master template.

Master pages are a feature of ASP. Net (the . Net web framework), so you are looking for a feature similar to master pages in a Java web framework.

tiles.apache.org/tutorial/basic/pages.html gives some basic examples using Tiles and JSP to implement something similar with Struts, a Java web framework. In this case, the Master Pages functionality is a plugin on top of Struts. Velocity is a generic templating engine, not specialized for web pages and definitely more complicated than you need.(I've seen it used for code generation.) Tapestry is more of a full featured web stack than Tile, and is probably good for your purposes.

Its templating functionality involves creating a component and putting all common markup in that. An example is at http://www.infoq.com/articles/tapestry5-intro.The specifics of this differ based on which Java web framework you choose.

You should also check out Facelets; there is a good introductory article on DeveloperWorks. The Facelets tag is comparable to the ASP. NET tag used in master pages; it lets you provide default content for that area of the page, but this can be overridden.To fill the Facelets template in another page, you start with a element that points to the template file.

This is roughly equivalent to declaring the MasterPageFile attribute in an ASP. NET page. Inside the element, you use elements to override the template defaults, similar to the way an tag is used.

These elements can contain any kind of content - from simple strings to JSF elements. So, to bring it all together... In master. Xhtml: Default content for AreaOne Default content for AreaTwo In page.

Xhtml: Here is some new content Some new content here too And this will render as: Here is some new content Some new content here too You also get some other benefits with Facelets, such as the ability to reuse page components with different data. (Edited to provide more information.).

I've used sitemesh in previous projects and it's pretty each to set up. Essentially you create decorators which are equivalents of master pages. You then define which child pages use which decorators.

See introduction to sitemesh for more information.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions