Re: RE: Struts7: looking for constant to set escapeHtml=false

2025-03-31 Thread Lukasz Lenart
pon., 24 mar 2025 o 20:04 Ute Kaiser  napisał(a):
> Thx Lukasz and Nate.
>
> I created MypropertyTag.java extending PropertyTag.java with my own method 
> setEscapeHtml but it was not called when the attribute escateHTML was not set 
> in jsp.
> So I decided to go with Nate and to add the attribute in jsp.
> Yet, MypropertyTag helped me with another problem: to call locale-specific 
> getter-methods of my bean.
> (This was done in my legacy Struts1 application by extending 
> org.apache.struts.taglib.bean.WriteTag; I had to replace that.)

If that works for you it's great - you can always register a ticket to
extend the functionality of  tag or propose a PR.


Regards
Łukasz

-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Aw: RE: Struts7: looking for constant to set escapeHtml=false

2025-03-24 Thread Ute Kaiser


Thx Lukasz and Nate.

I created MypropertyTag.java extending PropertyTag.java with my own method 
setEscapeHtml but it was not called when the attribute escateHTML was not set 
in jsp.
So I decided to go with Nate and to add the attribute in jsp.
Yet, MypropertyTag helped me with another problem: to call locale-specific 
getter-methods of my bean.
(This was done in my legacy Struts1 application by extending 
org.apache.struts.taglib.bean.WriteTag; I had to replace that.)

Best regards
Ute
 


> Gesendet: Montag, 24. März 2025 um 10:23
> Von: "Nate Kerkhofs" 
> An: "Struts Users Mailing List" 
> Betreff: RE: Struts7: looking for constant to set escapeHtml=false
>
> 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 


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



RE: Struts7: looking for constant to set escapeHtml=false

2025-03-24 Thread Nate Kerkhofs
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  
Sent: Saturday, 22 March 2025 16:45
To: Struts Users Mailing List 
Subject: Re: Struts7: looking for constant to set escapeHtml=false

sob., 22 mar 2025 o 15:19 Ute Kaiser  napisał(a):
>
> My application output is XML (not HTML), but German umlaute (ä,ö,ü) are 
> escaped for  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  
but maybe you can create a custom tag using 

[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: [email protected]
For additional commands, e-mail: [email protected]



Re: Struts7: looking for constant to set escapeHtml=false

2025-03-22 Thread Lukasz Lenart
sob., 22 mar 2025 o 15:19 Ute Kaiser  napisał(a):
>
> My application output is XML (not HTML), but German umlaute (ä,ö,ü) are 
> escaped for  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
 but maybe you can create a custom tag using


[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: [email protected]
For additional commands, e-mail: [email protected]



Struts7: looking for constant to set escapeHtml=false

2025-03-22 Thread Ute Kaiser
My application output is XML (not HTML), but German umlaute (ä,ö,ü) are escaped 
for  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...

Thx Ute

-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]