Hi Łukasz,

I might be mistaken, but a custom tag using s:component would probably lead to 
having to replace most if not all affected s:property tags in the project.

At that point, you might as well add the escapeHtml attribute to every 
s:property, because just replacing the s:property tags is probably going to be 
roughly the same amount as work as adding this attribute, and that's not 
accounting for writing the custom component.

I'm not familiar with the internal logic of Struts, but could Ute maybe create 
a custom struts-tags.tld file which defines a custom property tag using a 
NoEscapeHtmlPropertyTag tag-class that sets the escapeHtml property to false by 
default? It appears that all of the relevant classes are defined as public, so 
in theory this might work.

Regards,

Nate

-----Original Message-----
From: Lukasz Lenart <lukaszlen...@apache.org> 
Sent: Saturday, 22 March 2025 16:45
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: Struts7: looking for constant to set escapeHtml=false

sob., 22 mar 2025 o 15:19 Ute Kaiser <ut...@web.de.invalid> napisał(a):
>
> My application output is XML (not HTML), but German umlaute (ä,ö,ü) are 
> escaped for <s:property> and let the XML output crash in browser.
> Is there a way to configure e.g. struts.xml to set escapeHtml=false?
> (instead of adding it to every single row in every jsp)
>
> Part of my application is XML (display data only) Rest is HTML (data 
> processing) Each part has its own struts.xml, but only one common 
> struts.jar, so I can not change struts source.
>
> Migrating from Struts1 due to jakarta, hard enough...

There is "struts.ui.escapeHtmlBody" [1] but it doesn't include <s:property/> 
but maybe you can create a custom tag using <s:component/>

[1] https://struts.apache.org/tag-developers/tag-syntax#escaping-body-of-a-tag
[2] https://struts.apache.org/tag-developers/component-tag


Cheers
--
Łukasz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to