J2EE 1.4 Content Type Tidbit
Using Wireshark, you can detect some subtle differences in the j2ee 1.3 and 1.4 api’s as relating to http responses. One is difference is that PrintWriter appends the charset to the end of the content type (e.g. the MIME type) with a default of iso-8850-1. Also, setting the locale using response.setLocale() after setting the content type also appears to cause the charset to be appended to the content type.
Why is this an interesting find? Well, these extra characters have the potential of breaking things if client side code hasn’t been written well. For instance, a browser plugin that decides what to do with the response based on the MIME type may not know how to deal with a MIME type where ”;charset: iso-8850-1” is appended to the end. If these changes to the api are breaking someone else’s code :-(, you can work around these differences by writing the needed string in a jsp.
See future self, how would you ever have remembered that one if you hadn’t have written it down?
