Server-Side Development Section Index | Page 4
For loading and registering a driver you should use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"), but I have used JdbcOdbcDriver j=new JdbcOdbcDriver() and I still get a connection. Why is this so? Why should I use Class.forName("");
For loading and registering a driver you should use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"), but I have used JdbcOdbcDriver j=new JdbcOdbcDriver() and I still get a connection. Why is this s...more
Does JavaMail support accessing the preamble of a message?
JavaMail 1.4 adds get/setPreamble() methods to the MimeMultipart class. Some protocols like IMAP will not allow access to this text.
How can an application dynamically register protocol providers?
JavaMail 1.4 adds a new constructor public Provider(Type type, String protocol, String classname, String vendor, String version) for just such a need. You also need to use the new public void addP...more
How can I avoid making multiple HTTP calls for content that hasn't changed? Is it possible to cache it? Is there a way to set this in the header?
This can be achieved by using a filter. You can setup the filter in your web.xml to intercept the response and edit the HTTP headers for the specified content type. An example filter...more
How can I customize the method of Message-ID generation?
Starting with JavaMail 1.4, you can take advantage of the protected updateMessageID() method in your custom subclass of MimeMessage.
How can I send an attachment without having to use a physical file? - 08.31.06
How can I send an attachment without having to use a physical file?
How can I work with quotas without limiting myself to IMAP specific APIs?
See the QuotaAwareStore interface added to JavaMail 1.4. It is a new interface that the actual IMAP Store implements.
How do I find out the IMAP folder separator character?
Use the getSeparator() method of Folder, instead of checking if the folder exists first.
How do I fold/unfold long header lines?
Use the fold() and unfold() methods of MimeUtility, added to JavaMail 1.4. Previosly, the methods were present, but private.
How do you allow applications to dynamically register address type mappings?
See the public void setProtocolForAddress(String addresstype, String protocol) method of Session added to JavaMail 1.4.
How do you encode non-ASCII parameters in MIME headers?
If the mail.mime.encodeparameters System property is set to "true". non-ASCII parameters will be encoded per RFC 2231.
If the mail.mime.decodeparameters System property is set to "true". parameter...more
How do you specify the character set to use for a parameter?
Added to JavaMail 1.4, see the new public void set(String name, String value, String charset) method of ParameterList.
My attachment data is already base64 encoded, how do I avoid it being double encoded?
Use the new PreencodedMimeBodyPart class, added to JavaMail 1.4.
What is the difference between RequestDispatcher's forward(ServletRequest request, ServletResponse response) method and HttpServletResponse's sendRedirect(String location) method?
What is the difference between RequestDispatcher's forward(ServletRequest request, ServletResponse response) method and HttpServletResponse's sendRedirect(String location) method?
Where can I find out more about the features new to the 1.4 release of JavaMail?
JSR 919, http://jcp.org/en/jsr/detail?id=919 includes the information on the API changes for this release.