Chapter 6: Advanced Tomcat Features … mail/Session javax.mail.Session Container … Downloading and Installing JavaMail 1.3.3 and the JavaBeans Activation Framework 1.1 Libraries Check the %CATALINA_HOME%/lib directory to determine whether you have mail.jarand activation.jar libraries there. These are the JavaMail and JavaMail-dependent JAF libraries. If they are not there, they will need to be downloaded. JavaMail support is a part of the J2EE download, or it can be obtained as an optional download. You can find the required mail.jar library as part of the JavaMail distribution, downloadable from the following URL: http://java.sun.com/products/javamail/downloads/index.html The latest version available at the time of this writing is JavaMail 1.3.3. Because JavaMail 1.3.3 depends on JAF, you will also need to download the JavaBeans Activation Framework from the following URL: http://java.sun.com/products/javabeans/jaf/index.jsp The library that you will need from this download is activation.jar. Compiling and Configuring the SendMailServlet The code distribution includes the binaries for SendMailServlet. This sample servlet may already be part of your Tomcat 6 distribution. If not, copy the SendMailServlet.classfile into the webapps/ examples/WEB-INF/classesdirectory. To configure the servlet, add the following servlet definition and mapping to the web.xmldeployment descriptor of the jsp-examples Web application: SendMailServlet SendMailServlet SendMailServlet /mail/SendMailServlet Creating the sendmail.jsp JSP If sendmail.jsp is not included with your Tomcat 6 distribution, copy it from the code distribution to the %CATALINA_HOME%/webapps/examples/jsp/mail subdirectory (create this directory if necessary).
For high quality java hosting services please check tomcat web hosting website.
This entry was posted
on Saturday, March 21st, 2009 at 1:15 pm and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.