On Thu, Dec 20, 2012 at 11:00 AM, Paul Libbrecht <[email protected]> wrote:
> >
> > That's true but it does not prevent you to write directly in the response
> > if you want.
> >
> > Something like:
> >
> > ## Get the response buffer/stream
> > #set($out = $response.outputStream())
> >
> > ## Write some content to the response buffer
> > $out.print("some content")
> >
> > ## Make sure everything is sent
> > $out.flush()
> >
> > ## Indicate XWiki that you already sent the answer
> > $xcontext.setFinished(true)
>
> Hey, we're getting closer!
>
> How does this play with the velocity execution? Would its output be
> discarded then?
>
> I've tried this:
>
> $response.setContentType("text/plain")##
> #set($out = $response.outputStream())##
> ## Write some content to the response buffer
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")##
> $out.println("some content")
> ## Make sure everything is sent
> $out.flush()##
> ## Indicate XWiki that you already sent the answer
> $xcontext.setFinished(true)##
>
> and had only blank pages/
>
That's because you did not really wrote anything ;)
I made a mistake in my example, it's
#set($out = $response.outputStream)
without the parentheses.
>
> Paul
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
>
--
Thomas Mortagne
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users