Use tiles. It saved my life.
But if you can't, there's the include tag, making it similar to php.
The body tag might not actually do what you need it to, unless you have super simple content. The body tag is used to define the body of a specified element. Take a look at this example:
<jsp:element name="${content.headerName}"
xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:attribute name="lang">${content.lang}</jsp:attribute>
<jsp:body>${content.body}</jsp:body>
</jsp:element>
You specify the element name, any attributes that element might have ("lang" in this case), and then the text that goes in it--the body. So if
content.headerName = h1
,content.lang = fr
, andcontent.body = Heading in French
Then the output would be
<h1 lang="fr">Heading in French</h1>