You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by pbruski <gi...@git.apache.org> on 2014/12/09 17:20:02 UTC

[GitHub] struts pull request: WW-4427 - Converters are no longer applied to...

GitHub user pbruski opened a pull request:

    https://github.com/apache/struts/pull/32

    WW-4427 - Converters are no longer applied to values coming from the context

    fix and UT

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pbruski/struts develop

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/32.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #32
    
----
commit 6834b78fe9ec33e90530686e9c5101358750a854
Author: Przemek Bruski <pb...@atlassian.com>
Date:   2014-12-09T16:17:15Z

    WW-4427 - Converters are no longer applied to values coming from the context - fix and UT

----


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


[GitHub] struts pull request: WW-4427 - Converters are no longer applied to...

Posted by lukaszlenart <gi...@git.apache.org>.
Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/32#discussion_r21548312
  
    --- Diff: xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java ---
    @@ -351,6 +351,8 @@ private Object tryFindValue(String expr, Class asType) throws OgnlException {
                 value = getValue(expr, asType);
                 if (value == null) {
                     value = findInContext(expr);
    +                final XWorkConverter conv = ((Container)getContext().get(ActionContext.CONTAINER)).getInstance(XWorkConverter.class);
    --- End diff --
    
    Why do you looking for Converter instead of `@Inject` it? You can inject it with
    ```java
        private XWorkConverter conv;
    
        @Inject
        public void setXWorkConverter(XWorkConverter conv) {
            this.conv = conv;
        }
    ```


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


[GitHub] struts pull request: WW-4427 - Converters are no longer applied to...

Posted by lukaszlenart <gi...@git.apache.org>.
Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/32#discussion_r22206741
  
    --- Diff: xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java ---
    @@ -351,6 +352,7 @@ private Object tryFindValue(String expr, Class asType) throws OgnlException {
                 value = getValue(expr, asType);
                 if (value == null) {
                     value = findInContext(expr);
    +                return converter.convertValue(getContext(), value, asType);
    --- End diff --
    
    What will happen when value from context is null? Should it be converted? Can you add additional test case?


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


[GitHub] struts pull request: WW-4427 - Converters are no longer applied to...

Posted by lukaszlenart <gi...@git.apache.org>.
Github user lukaszlenart commented on a diff in the pull request:

    https://github.com/apache/struts/pull/32#discussion_r22218137
  
    --- Diff: xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java ---
    @@ -351,6 +352,7 @@ private Object tryFindValue(String expr, Class asType) throws OgnlException {
                 value = getValue(expr, asType);
                 if (value == null) {
                     value = findInContext(expr);
    +                return converter.convertValue(getContext(), value, asType);
    --- End diff --
    
    I've added it, time to merge :)


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


[GitHub] struts pull request: WW-4427 - Converters are no longer applied to...

Posted by pbruski <gi...@git.apache.org>.
Github user pbruski commented on a diff in the pull request:

    https://github.com/apache/struts/pull/32#discussion_r22236102
  
    --- Diff: xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java ---
    @@ -351,6 +352,7 @@ private Object tryFindValue(String expr, Class asType) throws OgnlException {
                 value = getValue(expr, asType);
                 if (value == null) {
                     value = findInContext(expr);
    +                return converter.convertValue(getContext(), value, asType);
    --- End diff --
    
    thanks!


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


[GitHub] struts pull request: WW-4427 - Converters are no longer applied to...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/struts/pull/32


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