You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Scott Sauyet <li...@sauyet.com> on 2007/12/05 15:44:23 UTC

Returning plain text / JSON data

Every now and then with Wicket, I find my self wanting to send plain 
text or Javascript/JSON data to the browser.  I know how to use, for 
instance, the StringHeaderContributer.  What I would like is for certain 
calls to simply return no HTML markup at all, just plain text.  For most 
of these needs, I could integrate something like DWR, and run on a 
separate servlet, but I generally need something from my Wicket session 
to build the output; I could do it, but it just doesn't make too much sense.

Is there a simple way to return plain text from an AJAX-y request?

Thanks for your help,

   -- Scott

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


Re: Returning plain text / JSON data

Posted by Scott Sauyet <li...@sauyet.com>.
Thank you very much.  I figured there must be an easy way...

   -- Scott

Igor Vaynberg wrote:
> onclick() {
> 
>    getrequestcycle().setrequesttarget(new stringrequesttarget("boo!"));
> 
> }
> 
> yeah, that easy :)
> 
> -igor
> 
> 
> On Dec 5, 2007 6:44 AM, Scott Sauyet <li...@sauyet.com> wrote:
>> Every now and then with Wicket, I find my self wanting to send plain
>> text or Javascript/JSON data to the browser.  I know how to use, for
>> instance, the StringHeaderContributer.  What I would like is for certain
>> calls to simply return no HTML markup at all, just plain text.  For most
>> of these needs, I could integrate something like DWR, and run on a
>> separate servlet, but I generally need something from my Wicket session
>> to build the output; I could do it, but it just doesn't make too much sense.
>>
>> Is there a simple way to return plain text from an AJAX-y request?
>>
>> Thanks for your help,
>>
>>    -- Scott
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 
> 


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


Re: Returning plain text / JSON data

Posted by Igor Vaynberg <ig...@gmail.com>.
onclick() {

   getrequestcycle().setrequesttarget(new stringrequesttarget("boo!"));

}

yeah, that easy :)

-igor


On Dec 5, 2007 6:44 AM, Scott Sauyet <li...@sauyet.com> wrote:
> Every now and then with Wicket, I find my self wanting to send plain
> text or Javascript/JSON data to the browser.  I know how to use, for
> instance, the StringHeaderContributer.  What I would like is for certain
> calls to simply return no HTML markup at all, just plain text.  For most
> of these needs, I could integrate something like DWR, and run on a
> separate servlet, but I generally need something from my Wicket session
> to build the output; I could do it, but it just doesn't make too much sense.
>
> Is there a simple way to return plain text from an AJAX-y request?
>
> Thanks for your help,
>
>    -- Scott
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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