velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <>
Subject Re: Mixing jsp content with tiles using tiles tool(possble soluti on!!!!)
Date Thu, 02 Oct 2003 04:15:37 GMT
Payne, Matthew said:
> I found a solution/fix.

cool.  though i wonder how this will affect character encoding issues.  this
is something you should bring up on the velocity-dev list where other
committers will see this.  i'm not gonna move on this without hearing some of
their thoughts.

i'd suggest writing up a quick summary of the problem and your solution and
posting it to the dev list.  you might also create a patch file against the
latest version of VelocityViewServlet (i just checked in some changes to it
today, so be sure you've updated it).  also, when you do that, remove the old
code first, don't just comment it out.

> Please take a look at this post.
> In short -----------------------------------------------------------
> you can't call response.getOutputStream() if something else called
> response.getWriter() in the same request.
> You will get an IllegalStateExeption.
> jsp calls response.getOutputStream(), lets be compatible with them
> ----------------------------------------------------------------------

huh?  don't you mean that jsp calls getWriter()?

> In light of this, I modified the mergeTemplate() method in
> VelocityViewServlet by
> replacing:
> //ServletOutputStream output = response.getOutputStream();
> with
> PrintWriter pw = response.getWriter(); (and commented out corresponding
> methods)
> This appears to work very well.  I tested this on tomcat and resin.
> By using response.getWriter(), this simple change would make the
> VelocityServlet "more" compatible with jsp.
> This should enabled velocity to be have better interchangeability with
> tiles/jsp.
> Mixed tiles definitions like this will work fine.
> What do you guys think of committing this type of change to the velocity
> tools (i don't have access)????

i'm interested in making this work, but i have my concerns.  i'd like to see
this discussed on velocity-dev first.

> Matthew Payne

Nathan Bubna

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message