From: markt Date: Fri, 19 Nov 2010 18:49:11 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50303 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=77f1eff4e91790afc1a674a425165fbf341534d0;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50303 Update JavaMail download location JAF is included in Java SE 6 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1036975 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 30edd4724..9a4b27d35 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -265,6 +265,10 @@ Improve Tomcat Logging documentation. (kkolinko) + + 50303: Update JNDI how-to to reflect new JavaMail download + location and that JAF is now included in Java SE 6. (markt) + diff --git a/webapps/docs/jndi-resources-howto.xml b/webapps/docs/jndi-resources-howto.xml index 763622f5a..e0011e2f6 100644 --- a/webapps/docs/jndi-resources-howto.xml +++ b/webapps/docs/jndi-resources-howto.xml @@ -456,7 +456,7 @@ Context envCtx = (Context) initCtx.lookup("java:comp/env"); Session session = (Session) envCtx.lookup("mail/Session"); Message message = new MimeMessage(session); -message.setFrom(new InternetAddress(request.getParameter("from")); +message.setFrom(new InternetAddress(request.getParameter("from"))); InternetAddress to[] = new InternetAddress[1]; to[0] = new InternetAddress(request.getParameter("to")); message.setRecipients(Message.RecipientType.TO, to); @@ -494,21 +494,22 @@ Transport.send(message);

4. Install the JavaMail libraries

-

- Download the JavaMail API. The JavaMail API requires the Java Activation - Framework (JAF) API as well. The Java Activation Framework can be downloaded - from Sun's site. -

+

+ Download the JavaMail API.

-

This download includes 2 vital libraries for the configuration; - activation.jar and mail.jar. Unpackage both distributions and place - them into $CATALINA_HOME/lib so that they are available to - Tomcat during the initialization of the mail Session Resource. - Note: placing these jars in both $CATALINA_HOME/lib and a - web application's lib folder will cause an error, so ensure you have - them in the $CATALINA_HOME/lib location only. +

Unpackage the distribution and place mail.jar into $CATALINA_HOME/lib so + that it is available to Tomcat during the initialization of the mail Session + Resource. Note: placing this jar in both $CATALINA_HOME/lib + and a web application's lib folder will cause an error, so ensure you have + it in the $CATALINA_HOME/lib location only.

+

5. Restart Tomcat

+ +

For the additional JAR to be visible to Tomcat, it is necessary for the + Tomcat instance to be restarted.

+ +

Example Application

The /examples application included with Tomcat contains