I sent the suggestion a while back to the expert group. 
> AFAIK, the and other tags don't actually generate *any* output
> of their own -- the extra line breaks you are seeing are undoubtedly those
> you've put in the source JSP page itself.


Yes, I was referring to the spaces that are generated by jasper because my original 
JSP source has:

<c:choose>

  <c:when></c:when>
  <c:otherwise></c:otherwise>
</c:choose>


> Can't you do this with a standard javax.servlet.Filter, without needing to
> integrate it into a compiler? A custom BodyTag of your own could
> certainly do the job as well.


I've considered it, but again it seems like a band-aid solution. It's a bit wasteful 
to have the servlet container generate out.print("\r\n") and then to have a filter 
strip it out. It might not matter for small sites. but if your website gets 1million+ 
hits a day, it adds up. It matters even more if other parts of your application are 
heavy weight and the server has to support a high number of concurrent requests. In my 
hand tweaked tests, it resulted in 10-20% performance improvement. Obviously this 
could easily be solved by putting <c:choose> statements all in one line, but that 
makes it a pain to read and debug. The test I ran had 400+ extra "\r\n" in the tag 
version vs hand tweaked. when the project requirements state you have to generate a 
complete page of results within 250ms and it takes 200ms to get XML from an app 
server, every bit helps :)

 

Most projects/sites do not have these kids of performance requirements, but it would 
make life easier. I also considered writing a class to parse my JSP before calling 
JSPC, so that's another approach that wouldn't break spec compliance.

 

peter






---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Reply via email to