Apache Struts 2 Documentation > Home > Guides > Tag Developers Guide > Struts Tags > UI Tags > Themes and Templates > simple theme > simple head template |

Apache Struts 2 Documentation
simple head template
Edit Page Browse Space Add Page Add News
Added by Patrick Lightbody, last edited by Ted Husted on Jan 08, 2007 (view change)

The simple theme head template only does one thing: it loads the minimal Ajax/Dojo support so that tags can import Dojo widgets easily.

The source of the simple head.ftl template is:

    <script language="JavaScript" type="text/javascript">
        // Dojo configuration
        djConfig = {
            baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams="none" encode='false'/>",
            isDebug: ${parameters.debug?default(false)},
            bindEncoding: "${parameters.encoding}",
            debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
        };
    </script>
    <script language="JavaScript" type="text/javascript"
            src="<@s.url includeParams='none' value='/struts/dojo/dojo.js' includeParams="none" encode='false'/>"></script>
    <script language="JavaScript" type="text/javascript"
            src="<@s.url includeParams='none' value='/struts/simple/dojoRequire.js' includeParams="none" encode='false'/>"></script>