Wednesday March 23, 2005
Trim Spaces in your JSP's HTML 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. Posted in Java at Mar 23 2005, 10:24:58 PM MST 32 Comments
Spring Live is done, but constantly improving
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.
Posted in Java
at Mar 23 2005, 09:49:34 PM MST
4 Comments
How IE handles PDFs 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. Posted in Java at Mar 23 2005, 09:29:56 PM MST 2 Comments
Round Squares with CSS 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. Posted in The Web at Mar 23 2005, 09:35:05 AM MST 2 Comments
Search This Site
Recent Entries
- Raible Road Trip #13
- The good ol' Job Hunt
- How to use GWT 2.0 with Maven and Generate SOYC Reports
- JSON Parsing with JavaScript Overlay Types in GWT
- A Fun Father's Day at Great Sand Dunes
- Going to the Great Sand Dunes for Father's Day
- Implementing OAuth with GWT
- Enhancing Evite.com with GWT and Grails
- 2nd Row at Red Rocks and Elephant Rock Ride
- Creating a Facebook-style Autocomplete with GWT