WW-5411 Delete unsupported static field templating

This commit is contained in:
Kusal Kithul-Godage
2024-07-26 17:03:51 +10:00
parent bf56c59d88
commit 9d624069aa
3 changed files with 6 additions and 16 deletions
@@ -20,6 +20,9 @@
*/
package org.apache.struts2.showcase.hangman;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
@@ -27,6 +30,8 @@ import java.util.List;
public class Hangman implements Serializable {
private static final Logger log = LogManager.getLogger(Hangman.class);
@Serial
private static final long serialVersionUID = 8566954355839652509L;
@@ -64,8 +69,8 @@ public class Hangman implements Serializable {
}
if (vocab.containsAllCharacter(charactersGuessed)) {
win = true;
log.info("Game won");
}
System.out.println(" *********************************** " + win);
}
}
@@ -42,7 +42,6 @@
"/>
<constant name="struts.allowlist.classes" value="
org.apache.struts2.showcase.hangman.Hangman,
org.apache.struts2.showcase.hangman.HangmanConstants,
org.apache.struts2.showcase.hangman.Vocab
"/>
@@ -18,7 +18,6 @@
* under the License.
*/
-->
<%@page import="org.apache.struts2.showcase.hangman.HangmanConstants" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
@@ -636,18 +635,5 @@
</div>
</div>
</div>
<br>
<br>
<p>
A secondary test for this JSP visually verifies expression access to a public constant.
A direct access to the same public constant via scriptlet provides secondary verification.
</p>
<br>
<div>
Test public static (constant) access (expression). Value: <s:property default="unavailable" value="@org.apache.struts2.showcase.hangman.HangmanConstants@HANGMAN_SESSION_KEY" />
</div>
<div>
Test public static (constant) access (scriptlet). Value: <%=org.apache.struts2.showcase.hangman.HangmanConstants.HANGMAN_SESSION_KEY%>
</div>
</body>
</html>