One of the annoying things about JSPs is all of the dynamic (non-rendered) parts of the page still produce line breaks. This means that if you do a view-source, you'll likely see large blocks of whitespace.
The good news is you can get rid of this whitespace if you're using Tomcat 5.5.x. Just locate the "jsp" servlet in $CATALINA_HOME/conf/web.xml and add the following <init-param>:
<init-param>
<param-name>trimSpaces</param-name>
<param-value>true</param-value>
</init-param>
I tested it and it works great. This begs the question - why isn't this on by default? Source: Struts Mailing List.
Update: JSP 2.1 adds the ability to trim whitespaces.
I've talked to a couple of Java developers lately that asked me "Sooo, when are you going to be done with Spring Live?" I was quite surprised to hear this because I finished it in October. I guess folks just aren't used to the constantly updated thing. Or maybe SourceBeat needs to do better marketing?
Regardless, Spring Live has been a blast to write. I was definitely hesitant when I signed up to write it b/c I didn't know much about Spring. But a year later, it seems to be getting good reviews and holding it's own when compared with the other Spring books. I'm also starting to see some traction from the book itself - not only in book sales, but also in training and invitations to speak at conferences.
If you're looking for Spring training, don't hesitate to contact me or SourceBeat directly. Also, the Spring Developers offer Spring training as does Rick Hightower.
From the Struts User Mailing List, I spotted a good explanation of how IE handles PDFs. It's quite messed up, so I thought I'd post it for your amusement.
If
your application returns data that is to be handled with an ActiveX
control (ie Adobe Acrobat Reader) the browser sends additional
requests to the server. In IE 4.x and 5 it actually sends three
requests. For IE 5.5+ it sends two.
Assuming that your using IE 5.5+, the first request is the original
request (duh), but then IE sends a second request to get the
content-type. Who knows why they can't figure this out on the first
request This second request has it's userAgent header set to
"contype". You can solve this problem and increase the performance of
your application by writing a Servlet filter that sits in front of
whatever Actions you have setup to serve PDF content. Have this
filter look at the userAgent header of each request. If it's set to
"contype" just send an an empty response back to the client with the
content type set to "application/pdf". Simple as that.
More info on this "feature" is on Microsoft's site.
Want to create squares with rounded corners - and only use CSS? If so, you might want to checkout the CSS Rounded Box Generator. Source: CSS Beauty.