ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Rodekamp <sascha.rodekamp.lynx...@googlemail.com>
Subject Re: AJAX JSON response
Date Thu, 01 Jul 2010 09:53:18 GMT
have a look at the DojoJSONServiceEventHandler.

The Way is simple pass your Arguments to your Event/ Service parse them into
a Jason Object (have a look here http://www.json.org/java/).
Do what ever you want :-)

And write back the result to the response Object.

Now you can work with the JSON Object in your Client.

I hope i could help

2010/7/1 Levenimeux <yassine.elkachchani@gmail.com>

> "Hi everybody ;
> i'm  an ofbiz framework beginner developper and in the application i'm
> developping i need to use AJAX in the client side. i'm now try to use Json
> for the response but i get no result . when i fire a request to the
> controler , instead of  updating the div i've prepared in the client side
> page i get a downlodable file wich content is the following one :
> -----------------------------------------------------
> {"targetRequestUri":"/testServiceAjax","_CONTEXT_ROOT_":"C:\\workspace\\ofbiz\\hot-deploy\\practice\\webapp\\practice\\","javax.servlet.request.key_size":128,"_FORWARDED_FROM_SERVLET_":true,"javax.servlet.request.ssl_session":"4c2b3a693e0b8204df23eb50f3c5bfe89ab1ae92c9d134be9b3d55fe55f5e284","_REQUEST_FROM_SPIDER_":"N","_SERVER_ROOT_URL_":"
> https://localhost:8443
> ","_LOGIN_PASSED_":"TRUE","_CONTROL_PATH_":"/practice/control","javax.servlet.request.cipher_suite":"SSL_RSA_WITH_RC4_128_MD5","thisRequestUri":"json"}
> --------------------------------------------------------
>  then  i suppose that i have this type of response because in my webapp
> controller there is no handler for the type Json .so  i search in ofbiz for
> any handler of the json  type and i find as reponse the common-controller
> of
> the common component in ofbiz (common
> /webcommon/webinf/common-controller.xml). while reading this controller and
> looking for any handler of the json type i found this comment :
> --------------------------------------------------
> <!-- These event handlers have been deprecated, if you need to send json
> responses then chain
>         the json request from this controller after calling your event
>    <handler name="jsonservice" type="request"
> class="org.ofbiz.webapp.event.JSONServiceEventHandler"/>
>    <handler name="jsonservice-multi" type="request"
> class="org.ofbiz.webapp.event.JSONServiceMultiEventHandler"/>
>    <handler name="jsonsimple" type="request"
> class="org.ofbiz.webapp.event.JSONSimpleEventHandler"/>
>    <handler name="jsonjava" type="request"
> class="org.ofbiz.webapp.event.JSONJavaEventHandler"/>
>     -->
> --------------------------------------------------
> so i make a copy of the last line in this comment to my app controller but
> i
> get the same response as described before... so now i have no idea of how
> to
> use this Json type in my webapp controller ...
>  can anyone explain me the  meaning of the comment i found in the
> common-cotroller or
> can anyone explain me the way to use Ajax with the JSON type in the
> controller  and some link about the subject will be welcome
> thank for advance ....  "
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/AJAX-JSON-response-tp2274772p2274772.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.

Sascha Rodekamp
   Lynx-Consulting GmbH
   Johanniskirchplatz 6
   D-33615 Bielefeld

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message