You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "John Lindal (JIRA)" <ji...@apache.org> on 2010/09/09 21:36:38 UTC

[jira] Created: (WW-3498) JSONInterceptor ignores Model pushed onto the ValueStack

JSONInterceptor ignores Model pushed onto the ValueStack
--------------------------------------------------------

                 Key: WW-3498
                 URL: https://issues.apache.org/jira/browse/WW-3498
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - JSON
    Affects Versions: 2.2.1
            Reporter: John Lindal


In JSON mode (not JSON-RPC), if this.root is not specified, the rootObject should be the top of the ValueStack, not the action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-3498) JSONInterceptor ignores Model pushed onto the ValueStack

Posted by "John Lindal (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Lindal updated WW-3498:
----------------------------

    Attachment: patch

Patch to fix this issue.

> JSONInterceptor ignores Model pushed onto the ValueStack
> --------------------------------------------------------
>
>                 Key: WW-3498
>                 URL: https://issues.apache.org/jira/browse/WW-3498
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.1
>            Reporter: John Lindal
>         Attachments: patch
>
>
> In JSON mode (not JSON-RPC), if this.root is not specified, the rootObject should be the top of the ValueStack, not the action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3498) JSONInterceptor ignores Model pushed onto the ValueStack

Posted by "John Lindal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907753#action_12907753 ] 

John Lindal commented on WW-3498:
---------------------------------

Note that this shouldn't break any existing code because nobody can currently use ModelDrivenInterceptor with the JSON plugin.

> JSONInterceptor ignores Model pushed onto the ValueStack
> --------------------------------------------------------
>
>                 Key: WW-3498
>                 URL: https://issues.apache.org/jira/browse/WW-3498
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.1
>            Reporter: John Lindal
>         Attachments: patch
>
>
> In JSON mode (not JSON-RPC), if this.root is not specified, the rootObject should be the top of the ValueStack, not the action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3498) JSONInterceptor ignores Model pushed onto the ValueStack

Posted by "Martin Gainty (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921350#action_12921350 ] 

Martin Gainty commented on WW-3498:
-----------------------------------

Once the rootObject is discovered
could you illustrate in the code where the ValueStack variable stack either push on the rootObject?

com.opensymphony.xwork2.util.ValueStack reference:
 /**
     * Put this object onto the top of the stack
     * @param o the object to be pushed onto the stack
     * @see CompoundRoot#push(Object)
     */
    public abstract void push(Object o);

thanks,
Martin

> JSONInterceptor ignores Model pushed onto the ValueStack
> --------------------------------------------------------
>
>                 Key: WW-3498
>                 URL: https://issues.apache.org/jira/browse/WW-3498
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.1
>            Reporter: John Lindal
>         Attachments: patch
>
>
> In JSON mode (not JSON-RPC), if this.root is not specified, the rootObject should be the top of the ValueStack, not the action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-3498) JSONInterceptor ignores Model pushed onto the ValueStack

Posted by "John Lindal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921455#action_12921455 ] 

John Lindal commented on WW-3498:
---------------------------------

If you look at my patch, you will see that the original code simply grabs the action if this.root is null.  For JSON mode, this is incorrect.  It should grab the top of the value stack instead.  The original code is correct for JSON-RPC, so my patch preserves this behavior.

> JSONInterceptor ignores Model pushed onto the ValueStack
> --------------------------------------------------------
>
>                 Key: WW-3498
>                 URL: https://issues.apache.org/jira/browse/WW-3498
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JSON
>    Affects Versions: 2.2.1
>            Reporter: John Lindal
>         Attachments: patch
>
>
> In JSON mode (not JSON-RPC), if this.root is not specified, the rootObject should be the top of the ValueStack, not the action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.