You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/31 22:40:26 UTC

[jira] [Resolved] (WW-3780) Make json plugin more extendable

     [ https://issues.apache.org/jira/browse/WW-3780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-3780.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.2
         Assignee: Lukasz Lenart

Patch applied, thanks!
                
> Make json plugin more extendable
> --------------------------------
>
>                 Key: WW-3780
>                 URL: https://issues.apache.org/jira/browse/WW-3780
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - JSON
>    Affects Versions: 2.3.1.2
>            Reporter: Pelladi Gabor
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 2.3.2
>
>         Attachments: WW-3780.diff
>
>
> Currently it is difficult to modify/extend the current behaviour of the json plugin.
> I had the following problem. We use joda-time because it is much better than standard Date. The json plugin cannot handle classes like LocalDate, which is not a problem in itself. But it needs a lot of boilerplate code to output beans containing a LocalDate field using json. Currently I have to create duplicates of the service layer DTO-s, annotate the fields in the UI copy with @JSONFieldBridge, and copy one DTO into the other using dozer or something.
> This creates a lot of useless code and manual work. It would be much easier if I could extend JSONWriter and add support for my joda-time classes. No duplication of DTO-s, no need to manually annotate all fields. This would require only to modify the visibility of some private methods to protected, and some package-protected classes to public. This way I could create my struts2 result type, which extends JSONResult, and use my writer, which extends JSONWriter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira