daljeetsingh wrote:
>
> Hello
>
> Need some help please. Just want to know if its a sin to use Velocity in
> a JSP framework, If it is I dont want to keep trying for too long.
Oh, not a sin :) I think its the first step on the road to
enlightenment :)
I tried a few weeks ago to get Velocity working in Struts - seems to
work fine, but I wasn't including the requests like you were - I was
using a distinct forward from a servlet w/o no output to a servlet that
did the velocity output, so it wasn't an issue.
>
> Finally I managed to include a template within a JSP page with a few
> changes to the VelocityServlet but than I realised that the finally
> clause in mergeTemplate method of VelocityServlet is closing the output
> stream. This gives stps the output for all the JSP pages that are
> included after the velocity template. To illustrate with an example:
>
> say: I have
>
> <jsp:include page="page1.jsp" flush="true" />
> <!-- This is the Velocity Template -->
> <jsp:include page="/servlet/SampleServlet" flush="true" />
> <jsp:include page="page2.jsp" flush="true" />
>
> The output that I get is
>
> Output from Page1.jsp
> Output from /servlet/SampleServlet
>
> Since Velocity closed the output stream the page2.jsp was not visible.
>
> Now if I comment output.close(); in the finalize clause everything works
> fine but I want to know if this causing me any other side effects. Just
> dont want to screw up really bad.
I wouldn't think so. We probably shouldn't be closing it anyway? I
would assume that the servlet running should take care of that. I will
look into it to see if the spec says anything. I
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."