See: Description
Class | Description |
---|---|
ServletMailUtil |
Note this is used in OA4MP and CILogon.
|
ServletMailUtilProvider |
Created by Jeff Gaynor
on 6/25/13 at 11:01 AM |
<Resource name="mail/Session" type="javax.mail.Session" auth="Container"/>Optionally, you made add the switch
mail.debug="true"
to this if you want to see lots of information about sending messages in the log
file. You can also just put this switch in your properties file too (no quotes).
<resource-ref> <description> Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. </description> <res-ref-name>mail/Session</res-ref-name> <res-type>javax.mail.Session</res-type> <res-auth>Container</res-auth> </resource-ref>
One issue is that Tomcat uses multiple class loaders, so that if you include Java Mail in your
webapp you will ge very strange ClassCastExceptions, e.g.
javax.mail.Session cannot be cast to javax.mail.Session
This is because classes themselves exist as objects different class loaders
have different instances of them, hence they are not identical so cannot be cast
to each other. Rather than have a massive kludge to let you add the mail jar to your
webapp, we'll require that you use Tomcat's system for this.
Copyright © 2019. All Rights Reserved.