struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yasserzamani <...@git.apache.org>
Subject [GitHub] struts issue #153: WW-4827 Not fully initialized ObjectFactory tries to crea...
Date Fri, 04 Aug 2017 12:46:29 GMT
Github user yasserzamani commented on the issue:

    https://github.com/apache/struts/pull/153
  
    @aleksandr-m , I modified `ObjectFactory` as below
    
    ```java
    ...
        private List<Object> myPrivateInjectQueue;
    ...
        @Inject
        public void setContainer(Container container) {
            this.container = container;
            if(null != this.container && null!=myPrivateInjectQueue && myPrivateInjectQueue.size()>0)
            {
                for(Object obj : myPrivateInjectQueue) this.container.inject(obj);
                myPrivateInjectQueue.clear();
                myPrivateInjectQueue=null;
            }
        }
    ...
        protected Object injectInternalBeans(Object obj) {
            if (obj != null) {
                if(container != null) container.inject(obj);
                else {
                    if(null==myPrivateInjectQueue)myPrivateInjectQueue=new ArrayList<Object>();
                    myPrivateInjectQueue.add(obj);}
            }
            return obj;
        }
    
    ```
    in your sample I got following ok result :)
    
    ```
    moving setContainer method to the last element of the array
    DateConverter.DateConverter()
    moving setContainer method to the last element of the array
    DateConverter.DateConverter()
    DateConverter.convertToString() localizedTextProvider=com.opensymphony.xwork2.util.StrutsLocalizedTextProvider@3f6f10fa
    
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message