Create re-usable code blocks within a JSP template

Sometimes you may have a block of code that you would like to output in multiple places in the page, and for whatever reason don’t want to use includes or tags. To do this you can use the <sm:block /> feature. To start you set the block as a variable:

<sm:setBlock var="_blockname">
	...
</sm:setBlock>

Then later in the page you can output it:

<sm:block name="_blockname" />