Hello Robbert, Let me try to explain:
On Jul 4, 2012, at 5:19 PM, Robert G. wrote:
> sorry, I have not got it and have to ask again :)
>
> I call a mapping to put things into the request object with that:
>
> /<request-map uri="checkInSession">
> <security https="false" auth="false"/>
> <event type="java" path="org.ofbiz.ecommerce.general.HelperMethods"
> invoke="checkInSession"/>
> <response name="response" type="request" value="json" />
Here you are using request-chain feature, if response matches with name then it
call another request.
> <response name="error" type="none" />
> </request-map>/
If you call an request via ajax call then you need to parse response in json
format, for this there is an request json that parse the responses to the json
formate,
<request-map uri="json">
<security direct-request="false"/>
<event type="java" path="org.ofbiz.common.CommonEvents"
invoke="jsonResponseFromRequestAttributes"/>
<response name="success" type="none"/>
</request-map>
Please see the jsonResponseFromRequestAttributes method form
commonEvents.java, this method take the http request and response and set the
content-type as "application/x-json" and
part pull out the service response from the request attribute and create a JSON
Object for return.
>
> then the method: checkInSession does the things into the http request object
>
> now I dont know how to automatical call the
> "jsonResponseFromRequestAttributes"
>
> or is it automatically called with the "<response name="response"
> type="request" value="json" />" ?
Yes json request call automatically (as request chain).
Thanks & Regards
--
Deepak Dixit
HotWax Media Pvt. Ltd.
www.hotwaxmedia.com
Contact :- +91-98267-54548
Skype :- deepakdixit
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Response-from-java-Method-to-client-Ajax-call-tp4634402p4634446.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
smime.p7s
Description: S/MIME cryptographic signature
