You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Yaytay (JIRA)" <ji...@apache.org> on 2011/01/05 09:49:47 UTC

[jira] Created: (WW-3553) Provide a tag to enable JSON output to be placed in an output page for any expression

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.


[jira] Assigned: (WW-3553) Provide a tag to enable JSON output to be placed in an output page for any expression

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

Maurizio Cucchiara reassigned WW-3553:
--------------------------------------

    Assignee: Maurizio Cucchiara

> 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
>            Assignee: Maurizio Cucchiara
>            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.


[jira] Commented: (WW-3553) Provide a tag to enable JSON output to be placed in an output page for any expression

Posted by "Yaytay (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (WW-3553) Provide a tag to enable JSON output to be placed in an output page for any expression

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977914#action_12977914 ] 

Maurizio Cucchiara commented on WW-3553:
----------------------------------------

I'm going to close this issue because there is already a struts tag that works exactly as you describe:

<%@ taglib prefix="json" uri="/struts-json-tags" %>
<c:out value="${json:serialize(bean)}"/>


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


[jira] Closed: (WW-3553) Provide a tag to enable JSON output to be placed in an output page for any expression

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

Maurizio Cucchiara closed WW-3553.
----------------------------------

    Resolution: Not A Problem

For further details see http://www.mail-archive.com/user@struts.apache.org/msg98338.html

> 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
>            Assignee: Maurizio Cucchiara
>            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.