craigmcc 01/03/24 13:15:25
Modified: catalina/src/conf server.xml
webapps/examples/WEB-INF web.xml
Log:
Update the examples webapp to include a definition of a javax.mail.Session
resource factory in "conf/server.xml", and a reference to it in web.xml.
From an application servlet or JSP page in this web app, you could
reference this JavaMail session resource as follows:
InitialContext context = new InitialContext();
javax.mail.Session sess =
(javax.mail.Session) context.lookup("java:comp/env/mail/session");
NOTE: If you are building Tomcat 4.0 from scratch, you will need
javamail.jar on your classpath in order to compile the object factory for
this resource.
Revision Changes Path
1.18 +8 -0 jakarta-tomcat-4.0/catalina/src/conf/server.xml
Index: server.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/server.xml,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- server.xml 2001/01/23 05:05:41 1.17
+++ server.xml 2001/03/24 21:15:24 1.18
@@ -195,6 +195,14 @@
<parameter><name>driverName</name>
<value>jdbc:HypersonicSQL:database</value></parameter>
</ResourceParams>
+ <Resource name="mail/session" auth="CONTAINER"
+ type="javax.mail.Session"/>
+ <ResourceParams name="mail/session">
+ <parameter>
+ <name>mail.smtp.host</name>
+ <value>localhost</value>
+ </parameter>
+ </ResourceParams>
</Context>
</Host>
1.14 +6 -0 jakarta-tomcat-4.0/webapps/examples/WEB-INF/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/web.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- web.xml 2001/03/22 17:50:30 1.13
+++ web.xml 2001/03/24 21:15:25 1.14
@@ -142,6 +142,12 @@
</taglib-location>
</taglib>
+ <resource-ref>
+ <res-ref-name>mail/session</res-ref-name>
+ <res-type>javax.mail.Session</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+
<security-constraint>
<display-name>Example Security Constraint</display-name>
<web-resource-collection>