Sure, I just put this in. Re: If you're feeling especially uppity, try your hand at a quick patch to the xdocs and attach it to your issue.
Sorry about the xdocs patch. I wasn't exactly sure how to do that. Matt -----Original Message----- From: Daniel L. Rall [mailto:[EMAIL PROTECTED] Sent: Sunday, October 05, 2003 5:17 PM To: [EMAIL PROTECTED] Cc: Velocity Developers List Subject: Re: Please consider this change (from user list) Matthew, this is an excellent suggestion. Would you file an issue in Bugzilla? If you're feeling especially uppity, try your hand at a quick patch to the xdocs and attach it to your issue. - Dan Payne, Matthew wrote: > Modify the mergeTemplate() method of the VelocityViewServlet > To use > PrintWriter pw = response.getWriter(); > > And use the PrintWriter instead of the ServletOutputStream. > > Refer to: > http://www.mail-archive.com/[EMAIL PROTECTED]/msg41885.ht > ml > > > 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.getWriter(), lets be compatible with them > > ---------------------------------------------------------- > > Why---> > 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. > > <definition name="jsplayout" > path="/layout.jsp"> > >>> <put name="header" >>> value="/header.vm"/> >>> <put name="footer" >>> value="/footer.jsp"/> >>> <put name="body" >>> value="/center/listThemes.vm"/> >>> <put name="rail" >>> value="/rail.jsp"/> >>></definition> > > > Here is the message from the user list. > > http://www.mail-archive.com/[EMAIL PROTECTED]/msg10683. > html > > Note though, this change will not completely help the opposite, where > a definition is based on a velocity layout. > > i.e. > > <definition name="vmlayout" > path="/layout.vm"> > >>> <put name="header" >>> value="/header.vm"/> >>> <put name="footer" >>> value="/footer.jsp"/> >>> <put name="body" >>> value="/center/listThemes.vm"/> >>> <put name="rail" >>> value="/rail.jsp"/> >>></definition> > > > In order for that to work, it would require an additional change to > the tiles tool. I know what needs to be done, but holding that for > another discussion. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
