struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Götz (JIRA) <>
Subject [jira] [Created] (WW-5006) NullPointerException in ProxyUtil class when accessing static member
Date Fri, 25 Jan 2019 07:57:00 GMT
Sebastian Götz created WW-5006:

             Summary: NullPointerException in ProxyUtil class when accessing static member
                 Key: WW-5006
             Project: Struts 2
          Issue Type: Bug
          Components: Value Stack
    Affects Versions: 2.5.20
            Reporter: Sebastian Götz

In some JSP we access static field (constants) of an interface. The interface has scope public
and and the fields are public static final.

When accessing the value of such a field the ValueStack throws a NullPointerException here
because there is actually not object (parameter holds null) when accessing a static member:

{{ * Check whether the given object is a proxy.}}
{{ * @param object the object to check}}
{{ */}}
{{ public static boolean isProxy(Object object) {}}
{{ Class<?> clazz = object.getClass();}}
{{ Boolean flag = isProxyCache.get(clazz);}}
{{ if (flag != null) {}}
{{ return flag;}}
{{ }}}{{boolean isProxy = isSpringAopProxy(object);}}{{isProxyCache.put(clazz, isProxy);}}
{{ return isProxy;}}
{{ }}}


Support to access static members is switched on via struts constant 

{{<constant name="struts.ognl.allowStaticMethodAccess" value="true" />}}

This message was sent by Atlassian JIRA

View raw message