Aw: Re: Struts7 Allowlist Capability

Ute Kaiser <[email protected]> Thu, 29 May 2025 18:40:38 +0000
Newsgroups gmane.comp.jakarta.struts.user
Message-ID <trinity-923d378b-279d-4edb-84d1-e966ac552cdd-1748544038327@trinity-msg-rest-webde-webde-live-689cb49c75-fbnzq>
Lukasz, thank you for your advice.
I got rid of almost all by moving logic into the action and passing new flags to jsp instead.

e.g.
Migrating struts1
<logic:present name="myList">
<logic:notEmpty name="myList">
by
<s:if test="%{myList != null && !myList.isEmpty()}">
raised
WARN  [org.apache.struts2.ognl.SecurityMemberAccess] (default task-2) Declaring class [class java.util.ArrayList] of member type [public boolean java.util.ArrayList.isEmpty()] is not allowlisted!

Solution according to your advice:
- Checking myList in the Action
- passing a new flag hasData=true|false to the jsp 
- <s:if test="%{hasData}">
worked.

One entry remaining in struts.allowlist.classes - the world won't end because of this :-)

Best regards
Ute