I am using tiles in struts2 application. While defining base layout I have defined an attribute "scriptFile".
<definition name="baseLayout" template="/application/base-layout.jsp" >
...
</definition>
<definition name="custom.tiles" extends="baseLayout">
<put-attribute name="scriptFile" value="js/custom-script.js"></put-attribute>
</definition>
If developer provides "scriptFile" in tiles definition file, "tiles.xml", this script file should be included using following line
<script language="javascript" src="<tiles:insertAttribute name="scriptFile"></tiles:insertAttribute>"></script>
But if scriptFile attribute is not defined, this line must be skipped.
How can I check the existence of "scriptFile" attribute in tiles. Is there any better way to do this thing?