[richfaces-issues] [JBoss JIRA] Created: (RF-6364) Seam mail sending failed when using rich/a4j components in mail body.

Mikhail Vitenkov (JIRA) jira-events at lists.jboss.org
Mon Feb 23 06:54:44 EST 2009


Seam mail sending failed when using rich/a4j components in mail body.
---------------------------------------------------------------------

                 Key: RF-6364
                 URL: https://jira.jboss.org/jira/browse/RF-6364
             Project: RichFaces
          Issue Type: Bug
    Affects Versions: 3.3.0
         Environment: IE6, IE7, FF 3.0.6, Safari 3.1, Opera 9.62, Chrome 1.0.154.43(3.3.0.GA)
            Reporter: Mikhail Vitenkov
            Assignee: Nick Belaevski


#1. Add following jar in your project:
jboss-seam-mail.jar, (mail.jar & activation.jar) - not for jboss AS
#2. Create page with facelets using seam email template. Note that a4j:commandLink present in page code:
<m:message xmlns="http://www.w3.org/1999/xhtml"
	xmlns:m="http://jboss.com/products/seam/mail"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core">
	<m:from name="Test" address="mvitenkov at exadel.com" />
	<m:to name="Mikhail Vitenkov">mihey.vit at gmail.com</m:to>
	<m:subject>Try out Seam!</m:subject>
	<m:body>
		<p><h:outputText value="Dear Mikhail" />,</p>
		<p>You can try out Seam by visiting			
				<a4j:commandLink value="http://labs.jboss.com/jbossseam" action="#"></a4j:commandLink>
		.</p>		
		<p>Regards,</p>
		<p>Mikhail Vitenkov</p>
	</m:body>
</m:message>
#3. On start page add command link, that call send method (just view rerendering):
<h:commandLink action="#{mail.send}" value="send e-mail" />

@Name("mail")
public class Mail {
	@In(create=true)
	private Renderer renderer;
	@In(create=true)
	public FacesMessages facesMessages;
	
	public Mail(){
		
	}
	
	public void send(){
		try {
			renderer.render("/pages/Mail.xhtml");
			facesMessages.add("Email sent successfully");
			}
			catch (Exception e) {
			facesMessages.add("Email sending failed: " + e.getMessage());
			}
	}
}
#4. Configure components.xml. Add jdni lookup and define smtp host server:
<mail:mail-session session-jndi-name="java:/Mail"/>
   <mail:mail-session host="mail.exadel.com" port="25" username="mvitenkov" password="*******" />
#5. Navigate to the page and click "send e-mail" command link.

Actual behavior: E-mail sending failed. But when replace a4j:commandLink with <a href="http://jboss.seam.org/">http://jboss.seam.org/</a> - e-mail send successfully. Link is present in mail body(see e-mail successfully sent.png)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list