You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2020/12/24 13:46:00 UTC

[jira] [Resolved] (WW-5106) The call chains of ActionContext.getContext() in ServletActionContext are dangerious

     [ https://issues.apache.org/jira/browse/WW-5106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-5106.
-------------------------------
    Resolution: Not A Problem

> The call chains of ActionContext.getContext() in ServletActionContext are dangerious
> ------------------------------------------------------------------------------------
>
>                 Key: WW-5106
>                 URL: https://issues.apache.org/jira/browse/WW-5106
>             Project: Struts 2
>          Issue Type: Bug
>            Reporter: Hao Zhong
>            Priority: Major
>             Fix For: 2.6
>
>
> The ServletActionContext class has many call chains of  ActionContext.getContext():
>  
>  
> {code:java}
> public static ActionMapping getActionMapping() {
>  return ActionContext.getContext().getActionMapping();
> }
> public static PageContext getPageContext() {
>  return ActionContext.getContext().getPageContext();
> }
> public static PageContext getPageContext() {
>  return ActionContext.getContext().getPageContext();
> }
> {code}
>  
>  
> ActionContext.getContext() can return null values. A previous bug was caused by the its null values. https://issues.apache.org/jira/browse/WW-3637
> The patch of WW-3637 is as follows:
> {code:java}
> private static void reloadBundles() {
> - reloadBundles(ActionContext.getContext().getContextMap());
> + reloadBundles(ActionContext.getContext() != null ? ActionContext.getContext().getContextMap() : null);
>  }
> {code}
> Either the implementation of ActionContext.getContext() or its call sites shall be revised. 
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)