You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2025/04/01 09:43:11 UTC
Re: Struts7 debug-tag with rendering problem
Do you use Struts 7.0.3? I addressed some issues around <s:debug/> in
this version
https://issues.apache.org/jira/browse/WW-5517
Also you can take a look on the Debugging example
https://github.com/apache/struts-examples/tree/main/debugging-struts
Cheers
Lukasz
czw., 27 mar 2025 o 10:25 Ute Kaiser <ut...@web.de.invalid> napisał(a):
>
>
> Hi,
> using <s:debug/> in jsp causes my XML-Output to crash.
> I thought I needed it because my jsp does not display the expected output and therefore I wanted to inspect the value stack.
> Any help appreciated to use this tag.
> Best regards Ute
>
>
> XML-Verarbeitungsfehler: Nicht übereinstimmendes Tag. Erwartet: </table>.
> Adresse: http://myURL
> Zeile Nr. 46, Spalte 7:
> </tr>
> ------^
>
> Translation: XML-error: not matching tag. expected: </table>
>
> Browser source shows:
> <h2>Struts ValueStack Debug</h2>
> <br>
>
> <h3>Value Stack Contents</h3>
> <table class="debugTable">
> <tr><th>Object</th><th>Property Name</th><th>Property Value</th><th>Property Class</th></tr>
>
> <tr>
> <td rowspan="20">xx.yyy.zzzz.MyAction</td>
>
>
> <td style="background-color:#CCCCCC;">container</td>
> <td style="background-color:#CCCCCC;">There is no read method for container</td>
> <td style="background-color:#CCCCCC;">class java.lang.String</td>
> </tr>
>
> <td style="background-color:#BBBBBB;">actionErrors</td>
> <td style="background-color:#BBBBBB;">[]</td>
> <td style="background-color:#BBBBBB;">class java.util.LinkedList</td>
> </tr>
>
> I found \struts-7.0.3\src\core\src\main\resources\template\simple\debug.ftl, but I am not familiar with #list to fully understand.
>
> <a href="#" id="toggle-button">[Debug]</a>
> <div style="display:none" id="<#if attributes.id??>${attributes.id}<#else>debug</#if>">
> <h2>Struts ValueStack Debug</h2>
> <br>
>
> <h3>Value Stack Contents</h3>
> <table class="debugTable">
> <tr><th>Object</th><th>Property Name</th><th>Property Value</th><th>Property Class</th></tr>
>
> <#assign index=1>
> <#list attributes.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 style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;">${propertyName}</td>
> <td style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;"><#if stackObject.value.get(propertyName)??>${stackObject.value.get(propertyName).toString()}<#else>null</#if></td>
> <td style="background-color:<#if (index % 2) == 0>#BBBBBB<#else>#CCCCCC</#if>;"><#if stackObject.value.get(propertyName)??>${stackObject.value.get(propertyName).class}<#else>null</#if></td>
> </tr>
> <#assign index= index + 1>
> </#list>
> </#list>
> </table>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Re: Struts7 debug-tag with rendering problem
Posted by Lukasz Lenart <lu...@apache.org>.
wt., 1 kwi 2025 o 12:09 Ute Kaiser <ut...@web.de.invalid> napisał(a):
> yes, I use Struts 7.0.3
> I suppose it is just a missing <tr>, that browser usually excuses for html but not for my xml output.
I've used the example app but I cannot find the issue, there is
opening <tr> & closing </tr> tag, also I used W3C validator to check
the output and it was only complaining about missing <tbody>
Cheers
Łukasz
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Aw: Re: Struts7 debug-tag with rendering problem
Posted by Ute Kaiser <ut...@web.de.INVALID>.
Hi Lukasz,
yes, I use Struts 7.0.3
I suppose it is just a missing <tr>, that browser usually excuses for html but not for my xml output.
Thx and best regards Ute
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org