[ 
https://issues.apache.org/jira/browse/WW-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977688#action_12977688
 ] 

Yaytay commented on WW-3553:
----------------------------

As a starting point I've taken the source code for the Property tag and changed 
it to have:
        Object objectValue = getStack().findValue(value, 
throwExceptionOnELFailure);
        try {
            actualValue = JSONUtil.serialize( objectValue );
        } catch( JSONException ex ) {
            LOG.error("Could not convert {} to a JSON serialized value: {}", 
objectValue, ex);
        }


> Provide a tag to enable JSON output to be placed in an output page for any 
> expression
> -------------------------------------------------------------------------------------
>
>                 Key: WW-3553
>                 URL: https://issues.apache.org/jira/browse/WW-3553
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Plugin - JSON
>    Affects Versions: 2.2.1
>            Reporter: Yaytay
>            Priority: Minor
>
> I frequently need to have JSON included in an HTML page downloaded by the 
> client (i.e. not via AJAX).
> This is typically then processed by client-side javascript (often using 
> jqGrid).
> There are a few ways that this can be achieved currently, but they are all 
> cumbersome and inflexible (requiring code to be written for every thing that 
> needs to be expressed in JSON).
> It would be much more convenient to have a tag that could express any OGNL 
> expression as JSON.

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

Reply via email to