debug.ftl

来自「JSP(Java Server Pages)是由Sun Microsystems」· FTL 代码 · 共 59 行

FTL
59
字号
<script type="text/javascript">
<!--
    function toggleDebug(debugId) {
        var debugDiv = document.getElementById(debugId);
        if (debugDiv) {
            var display = debugDiv.style.display;
            if (display == 'none') {
                debugDiv.style.display = 'block';
            } else if (display == 'block') {
                debugDiv.style.display = 'none';
            }
        }
    }
-->
</script>
<p />

<a href="#" onclick="toggleDebug('<#if parameters.id?if_exists != "">${parameters.id?html}<#else>debug</#if>');return false;">[Debug]</a>
<div style="display:none" id="<#if parameters.id?if_exists != "">${parameters.id?html}<#else>debug</#if>">
<h2>Struts ValueStack Debug</h2>
<p />

<h3>Value Stack Contents</h3>
<table border="0" cellpadding="2" cellspacing="0" width="400" bgcolor="#DDDDDD">
    <tr><th>Object</th><th>Property Name</th><th>Property Value</th></tr>

    <#assign index=1>
    <#list parameters.stackValues as stackObject>
    <tr>
        <td rowspan="${stackObject.value.size()}">${stackObject.key}</td>

        <#assign renderRow=false>
        <#list stackObject.value.keySet() as propertyName>
            <#if renderRow==true></tr><tr><#else> <#assign renderRow=false> </#if>
            <td bgcolor="<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>">${propertyName}</td>
            <td bgcolor="<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>"><#if stackObject.value.get(propertyName)?exists>${stackObject.value.get(propertyName).toString()}<#else>null</#if></td>
    </tr>
            <#assign index= index + 1>
        </#list>
    </#list>
</table>
<p />

<h3>Stack Context</h3>
<i>These items are available using the #key notation</i>
<table border="0" cellpadding="2" cellspacing="0" width="400" bgcolor="#DDDDDD">
    <tr>
        <th>Key</th><th>Value</th>
    </tr>

    <#assign index=1>
    <#list stack.context.keySet() as contextKey>
    <tr bgcolor="<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>">
        <td>${contextKey}</td><td><#if stack.context.get(contextKey)?exists>${stack.context.get(contextKey).toString()}<#else>null</#if></td>
    </tr>
        <#assign index= index + 1>
    </#list>
</table>
</div>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?