You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Kevin Liu <mr...@yahoo.com> on 2008/01/15 03:43:18 UTC

How to write Json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget)

Hi guys!
 could you tell me how to write json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget) method?
 my code :
...
Response response = getResponse();         response.write("{totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}");
...
but the response is like this:

{totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}<?xml version="1.0" encoding="UTF-8"?>

<ajax-response></ajax-response>
how can I remove the 
<?xml version="1.0" encoding="UTF-8"?><ajax-response></ajax-response>





-Kevin Liu
       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

RE: How to write Json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget)

Posted by "Hoover, William " <wh...@nemours.org>.
Add/Edit if necessary http://cwiki.apache.org/confluence/x/3CIB

-----Original Message-----
From: Kevin Liu [mailto:j2eekevinliu@yahoo.com]
Sent: Monday, January 14, 2008 11:07 PM
To: users@wicket.apache.org
Subject: Re: How to write Json response in the
AbstractDefaultAjaxBehavior.response(ajaxtarget)


Thank you , it works!

Igor Vaynberg <ig...@gmail.com> wrote: getrequestcycle().setrequesttarget(new irequesttarget() {
respond(response r) { r.write(...); }});

-igor


On Jan 14, 2008 6:43 PM, Kevin Liu  wrote:
> Hi guys!
>  could you tell me how to write json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget) method?
>  my code :
> ...
> Response response = getResponse();         response.write("{totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}");
> ...
> but the response is like this:
>
> {totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}
>
> 
> how can I remove the
> 
>
>
>
>
>
> -Kevin Liu
>
> ---------------------------------
> Never miss a thing.   Make Yahoo your homepage.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org




-Kevin Liu
       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to write Json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget)

Posted by Kevin Liu <j2...@yahoo.com>.
Thank you , it works!

Igor Vaynberg <ig...@gmail.com> wrote: getrequestcycle().setrequesttarget(new irequesttarget() {
respond(response r) { r.write(...); }});

-igor


On Jan 14, 2008 6:43 PM, Kevin Liu  wrote:
> Hi guys!
>  could you tell me how to write json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget) method?
>  my code :
> ...
> Response response = getResponse();         response.write("{totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}");
> ...
> but the response is like this:
>
> {totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}
>
> 
> how can I remove the
> 
>
>
>
>
>
> -Kevin Liu
>
> ---------------------------------
> Never miss a thing.   Make Yahoo your homepage.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org




-Kevin Liu
       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: How to write Json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget)

Posted by Igor Vaynberg <ig...@gmail.com>.
getrequestcycle().setrequesttarget(new irequesttarget() {
respond(response r) { r.write(...); }});

-igor


On Jan 14, 2008 6:43 PM, Kevin Liu <mr...@yahoo.com> wrote:
> Hi guys!
>  could you tell me how to write json response in the AbstractDefaultAjaxBehavior.response(ajaxtarget) method?
>  my code :
> ...
> Response response = getResponse();         response.write("{totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}");
> ...
> but the response is like this:
>
> {totalProperty:100,root:[{id:0,name:'name0',descn:'descn0'},]}<?xml version="1.0" encoding="UTF-8"?>
>
> <ajax-response></ajax-response>
> how can I remove the
> <?xml version="1.0" encoding="UTF-8"?><ajax-response></ajax-response>
>
>
>
>
>
> -Kevin Liu
>
> ---------------------------------
> Never miss a thing.   Make Yahoo your homepage.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org