John McNally wrote:
>
> There is the option of direct output in the VelocityService. It should
> be relatively easy to restructure VelocityOnlyLayout (I think it should
> be renamed VelocityDirectLayout, since part of the idea is to support
> jsp screens within velocity layouts.) Create a context tool or possibly
> two (velocity and jsp variations) to handle the screen.
>
> Why doesn't Jetspeed do this? Is there something I am missing that
> makes it harder than I think?
>
Thanks John for this information, I was not aware a this new method in VelocityService.
I've just tried it out and while it shows promise it does not solve completely the
issue.
I've written a VelociyDirectLayout using the direct output support in VelocityService
to test the functionality but I have then 2 different issues:
- using only Velocity Templates, I now get out of order output of processed Velocity
templates, the latest template processed being the first flushed. This is certainly
because Velocity buffers internally the generated template content before writing
the content to the stream.
I understand why it's not a good idea to flush everytime the engine evaluate a
directive so I think Velocity should provide a way to control when to flush content
within the template merge process (I tried pasing a reference to the servlet
outputstream in the context and flush it from within the template but it doesn't
work)
- trying to include a JSP or servlet through RequestDispatchere, I have a
IllegalStateError
because I need to use HttpServletResponse.getOutputStream() to pass it to the
VelocityService
whereas the RequestDispatcher will try to use getWriter().
This can easily be solved by adding a new method signature in VelocityService
void handleRequest(RunData, Context, Writer)
looking at the code, I'm not sure why it uses an OutputStream in the first place...
if
someone cares to explain the issue I can write up a patch quite easily.
--
Rapha�l Luta - [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]