Open glassfishrobot opened 17 years ago
@glassfishrobot Commented Reported by ntruchsess
@glassfishrobot Commented ntruchsess said: Created an attachment (id=17) Proposal how to store xjson-header in RequestParameterMap
@glassfishrobot Commented ntruchsess said: Created an attachment (id=18) org.json.* classes from www.json.org
@glassfishrobot Commented ntruchsess said: Created an attachment (id=19) Alternative Proposal that stores the JSONObject in AsyncResponse
@glassfishrobot Commented File: diff-xjson_in_requestparametermap.txt Attached By: ntruchsess
@glassfishrobot Commented File: diff-xjson_in_ThreadLocal_AsyncResponse.txt Attached By: ntruchsess
@glassfishrobot Commented File: json.zip Attached By: ntruchsess
@glassfishrobot Commented Was assigned to jsf-extensions-issues
@glassfishrobot Commented This issue was imported from java.net JIRA JSF_EXTENSIONS-66
modification of xjson-header on serverside now can only be archived by direct manipulation of HttpServletResponse headers. This is problematic if several independent components try to access and modify this header (there is no getter-method to retrive previously set headers from HttpServletResponse and reading the original header from RequestHeaderMap does not give information whether this header was previously modified or not).
To ease modification of the X-JSON header on the serverside the header could be parsed into an JSONObject (see http://www.json.org/java/index.html). This JSONObject could be made accessible by being stored either as an Entry in the RequestParameterMap or in the ThreadLocal AsyncResponse. For convenience AsyncResponse might bring a getXJSON()-method.
All components would retrieve references to the same JSONObject - this way modifications to independent members of the JSONObject do not overwrite other components modifications as this is the case if components set the response-header directly.
The JSONObject would finally be written to the responseheader by e.g. PartialTraversalViewRootHelper.encodePartialResponseEnd.
Environment
Operating System: All Platform: All
Affected Versions
[current]