gpt4 book ai didi

java - 对静态变量的访问被阻止

转载 作者:行者123 更新时间:2023-12-02 11:50:09 25 4
gpt4 key购买 nike

在我的 Struts2 应用程序中,涉及一些多线程,我在日志中收到以下警告:

Access to static [private static final java.lang.String ...] is blocked!

此警告是什么意思以及如何避免它?

最佳答案

默认情况下禁用静态访​​问。 Here您可以了解有关静态访问器的更多信息。

OGNL allows execution of methods, but the static access is disabled by default, so you cannot use static method in expressions. However, you can teach OGNL which classes needs to access the static methods.

关于java - 对静态变量的访问被阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47940732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com