Changeset 3485


Ignore:
Timestamp:
02/06/12 23:57:59 (3 months ago)
Author:
garth
Message:

view webapp - jndi email config working

Location:
trunk/src/main/webapps
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/user.xml

    r3484 r3485  
    3333        </bean> 
    3434 
     35<bean id="User.MailSession" class="org.springframework.jndi.JndiObjectFactoryBean"> 
     36  <property name="jndiName"><value>java:comp/env/mail/doh_ibisph</value></property> 
     37</bean> 
     38 
     39<bean id="User.MailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> 
     40    <property name="session" ref="User.MailSession"/> 
     41</bean> 
    3542 
    3643        <!-- S E R V I C E S --> 
     
    4249 
    4350<!-- 
    44   <Resource name="mail/Session" 
    45               auth="Container" 
    46               type="javax.mail.Session" 
    47               username="yourusername" 
    48               password="yourpassword" 
    49               mail.debug="true" 
    50               mail.user="yourusername" 
    51               mail.password="yourpassword" 
    52               mail.transport.protocol="smtp" 
    53               mail.smtp.host="your.smtphost.com" 
    54               mail.smtp.auth="true" 
    55               mail.smtp.port="25" 
    56               mail.smtp.starttls.enable="true"/> 
    57 </Context> 
    58  
    59 <bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean"> 
    60   <property name="jndiName"><value>java:/Mail</value></property> 
    61 </bean> 
    62  
    63 <bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean"> 
    64   <property name="jndiName"><value>java:comp/env/mail/Session</value></property> 
    65 </bean> 
    66  
    67 <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> 
    68     <property name="session" ref="mailSession"/> 
    69 </bean> 
    70  
    7151http://wheelersoftware.com/articles/spring-javamail-2.html 
    72  
    7352 
    7453if you're using JDK 1.5 or earlier, include the 
     
    8160        http://www.javacodegeeks.com/2010/07/java-mail-spring-gmail-smtp.html 
    8261 
    83  
    84                 <property name="host" value="smtp.gmail.com"/> 
    85                 <property name="port" value="587"/> 
    86                 <property name="username" value="garth.braithwaite@stgutah.com"/> 
    87                 <property name="password" value="021561"/> 
    88                 <property name="javaMailProperties"> 
    89                         <props> 
    90                                 <prop key="mail.smtp.auth">true</prop> 
    91                                 <prop key="mail.smtp.starttls.enable">true</prop> 
    92                         </props> 
    93                 </property> 
    94  
    9562velocity template example: 
    9663http://www.javabeat.net/articles/83-email-integration-in-spring-framework-1.html 
    97  
    9864--> 
    9965 
    100         <bean id="User.MailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> 
     66 
     67        <bean id="User.MailSender.LOCAL_CONFIG" class="org.springframework.mail.javamail.JavaMailSenderImpl"> 
    10168                <property name="host" value="smtp.gmail.com"/> 
    10269                <property name="port" value="25"/> 
    10370                <property name="username" value="garth.braithwaite@stgutah.com"/> 
    104                 <property name="password" value="021561"/> 
     71                <property name="password" value=""/> 
    10572                <property name="javaMailProperties"> 
    10673                        <props> 
  • trunk/src/main/webapps/ibisph-view/WEB-INF/web.xml

    r3484 r3485  
    9595 
    9696 
    97         <!-- =========================================== J N D I   R E S O U R C E S  
     97        <!-- =========================================== J N D I   R E S O U R C E S --> 
     98        <!-- why to use resource-ref: http://stackoverflow.com/questions/2887967/what-is-resource-ref-in-web-xml-used-for --> 
    9899        <resource-ref> 
    99100                <description>Resource reference to the app server container managed JNDI database connection factory</description> 
     
    108109                <res-auth>Container</res-auth> 
    109110        </resource-ref> 
    110 --> 
     111 
    111112 
    112113        <!-- ===================================================== L I S T E N E R S --> 
Note: See TracChangeset for help on using the changeset viewer.