thats the way to do it yes
always work with RequestTargets to write stuff
johan
On Fri, Mar 28, 2008 at 11:25 PM, Michael Mehrle <[EMAIL PROTECTED]>
wrote:
> Actually, your line throws IllegalStateException: STREAM
>
> I tried this, which seems to work as well and doesn't throw that
> exception:
>
> RequestCycle.get().setRequestTarget(new IRequestTarget() {
> public void respond(RequestCycle requestCycle) {
> Response rep = requestCycle.getResponse();
> Rep.write("foo");
> }
> });
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 28, 2008 2:44 PM
> To: [email protected]
> Subject: Re: Writing directly to the HTTP Response object?
>
> wicket is probably buffering the response, so you should try
> ((webresponse)getresponse).gethttpservletresponse().getoutputstream().wr
> ite
>
> -igor
>
>
> On Fri, Mar 28, 2008 at 2:16 PM, Michael Mehrle <[EMAIL PROTECTED]>
> wrote:
> > I have a non-Wicket AJAX request call a Wicket page to process some
> data
> > (it's that jQuery file uploader I was working on). Now, the PHP
> example
> > that came with that jQuery based file uploader writes out some status
> > information to the AJAX JS script via HTTP Response like this (I'm no
> > PHP coder):
> >
> > { echo "{";
> > Echo "error: ': . $error . "',\n";
> > Echo "msg: '" . $msg . "'\n";
> > Echo "}"
> >
> > That's the message that the JS will use to show the status. Now,
> since
> > I'm in Wicket, not in PHP I will need to bounce back something
> similar.
> > I was hoping that I could just call:
> >
> > getRequest().write(....);
> >
> > However, it's not showing up. What is the recommended way of writing
> > directly to the response object (for this, or RSS feeds, etc..). Do I
> > have to create a fake txt/xml page that I'm bouncing back, or can I
> just
> > write plain text back via the HTTP Response object?
> >
> > Any help would be appreciated.
> >
> > Best,
> >
> > Michael
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>