struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleksandr-m <...@git.apache.org>
Subject [GitHub] struts issue #153: WW-4827 Not fully initialized ObjectFactory tries to crea...
Date Tue, 01 Aug 2017 17:07:14 GMT
Github user aleksandr-m commented on the issue:

    https://github.com/apache/struts/pull/153
  
    Nope, #155 doesn't seem have any effect.
    
    Add following files to project, run under *nix, execute some action which lead to the
JSP,  `localizedTextProvider` should not be `null` in system outs. 
    
    xwork-conversion.properties;
    
        java.util.Date=com.DateConverter
    
    JSP:
      
        <s:bean var="d" name="java.util.Date" />
        <s:property value="#d" />
    
    DateConverter:
    ```
    public class DateConverter extends StrutsTypeConverter {
    
        private LocalizedTextProvider localizedTextProvider;
    
        @Inject
        public void setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider)
{
            this.localizedTextProvider = localizedTextProvider;
        }
    
        @Override
        public Object convertFromString(Map context, String[] values, Class toClass) {
            System.out.println("DateConverter.convertFromString() localizedTextProvider="
+
                                          localizedTextProvider);
            return null;
        }
    
        @Override
        public String convertToString(Map context, Object obj) {
            System.out.println("DateConverter.convertToString() localizedTextProvider=" +
                                          localizedTextProvider);
            return "";
        }
    }
    ```
    



---
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