[ https://issues.apache.org/jira/browse/OFBIZ-3365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793319#action_12793319 ]
Scott Gray commented on OFBIZ-3365: ----------------------------------- I'd be interested in hearing the thoughts of the community on this one, here's my mine: * I like the approach but I'm loathe to commit another json specific event handler * This problem can't be solved using the chained json event that I committed recently since there is no way to know what service was called earlier in the chain * I don't like our current approach of blindly sending off all request attributes to the client The only solution I can think of at the moment is to exclude request attributes set in the ControlServlet and RequestHandler but I fear that will only be a temporary solution because people won't remember to add new attributes to the exclusion list. > Clean JSON Service Event Handler > -------------------------------- > > Key: OFBIZ-3365 > URL: https://issues.apache.org/jira/browse/OFBIZ-3365 > Project: OFBiz > Issue Type: Improvement > Components: framework > Affects Versions: Release Branch 4.0, Release Branch 9.04, SVN trunk > Reporter: Frank Lam > Assignee: Scott Gray > Priority: Minor > Fix For: Release Branch 4.0, Release Branch 9.04, SVN trunk > > Attachments: cleanjson.patch > > > I ran into a small issue while using > org.ofbiz.webapp.event.JSONServiceEventHandler (typically referred to as > "jsonservice" in controller files). If I defined my service as such: > <service name="foo" engine="java" location="my.Class" invoke="someFunction"> > <attribute name="mylist" mode="OUT" type="List" optional="true"/> > </service> > I would get the following in the content of my response: > {"targetRequestUri":"/foo","thisRequestUri":"foo","mylist":[{some:stuff}],"multiPartMap":{},"_CONTROL_PATH_":"/myapp/control","_CONTEXT_ROOT_":"/Users/me/Documents/workspace/ofbiz/hot-deploy/mycomponent/webapp/myapp/","_SERVER_ROOT_URL_":"http://localhost:8080"} > where I would prefer to receive simply: > {"mylist":[{some:stuff}]} > I've added another event handler to try to resolve this problem. The patch > is attached. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.