[jboss-cvs] jboss-seam/examples/mail/view ...

Peter Muir peter at bleepbleep.org.uk
Sun Jan 21 09:41:54 EST 2007


  User: pmuir   
  Date: 07/01/21 09:41:54

  Added:       examples/mail/view     html.xhtml index.xhtml
                        plainText.xhtml index.html
  Log:
  JBSEAM-626 Example for mail support
  
  Revision  Changes    Path
  1.1      date: 2007/01/21 14:41:54;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/html.xhtml
  
  Index: html.xhtml
  ===================================================================
  <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:m="http://jboss.com/products/seam/mail"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">
        <m:message>
  	      <m:from name="Peter Muir" address="pmuir at bleepbleep.org.uk" />
  	      <m:to name="Peter Muir" address="pmuir at tardis.ed.ac.uk" />
  	      <m:subject>Seam Mail</m:subject>
  	      <m:body>
  	      	<html>
  	      		<body>
  	      			<p><b>Peter,</b></p>
  	      			<p>This is an example <i>HTML</i> email sent by Seam.</p>
  	      			<p>It has an alternative text body for mail readers that don't support html.</p>
  	      		</body>
  	      	</html>
  	      	<f:facet name="alternative">
  	      		<h:outputText>This is the alternative text body for mail readers that don't support html</h:outputText>
  	      	</f:facet>
  	      </m:body>
       </m:message>
       <html>
  	     <body>
  	     	<p>The email has been successfully sent. <s:link view="/index.xhtml">Click here</s:link> to return to the index.</p>
  	     </body>
       </html>
  </ui:composition>
  
  
  1.1      date: 2007/01/21 14:41:54;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/index.xhtml
  
  Index: index.xhtml
  ===================================================================
  <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">
  
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Seam Mail</title>
      <ui:remove><link href="screen.css" rel="stylesheet" type="text/css" /></ui:remove>
  </head>
  <body>
     
      <h1>Sample Emails</h1>
      
      <p>If you aren't running a smtp server on localhost:25 you set one in components.xml</p>
      
      <h:form>
      	<h:panelGrid columns="2">
  	    	<h:outputText value="Name" />
  	    	<h:panelGroup>
  		    	<h:inputText value="#{person.firstname}" required="true" />
  		    	<h:inputText value="#{person.lastname}" required="true" />
  		    </h:panelGroup>
  		    <h:outputText value="Email Address" />
  		    <h:inputText value="#{person.address}" rerquired="true"/>
  		    <h:commandButton action="plainText" value="Send Plain Text Email" />
  	        <h:commandButton action="html" value="Send HTML Email" />
  		</h:panelGrid>
      </h:form>
  </body>
  </html>
  
  
  
  1.1      date: 2007/01/21 14:41:54;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/plainText.xhtml
  
  Index: plainText.xhtml
  ===================================================================
  <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:m="http://jboss.com/products/seam/mail"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">
        <m:message session="#{myMailSession}">
  	      <m:from name="Seam" address="do-not-reply at jboss.com" />
  	      <m:replyTo>#{person.address}</m:replyTo>
  	      <m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
  	      <m:subject>Plain text email sent by Seam</m:subject>
  	      <m:body type="plain">Dear #{person.firstname},
  	      
  This is a simple, plain text, email.
  	      
  Regards
  	      
   JBoss Seam Mail</m:body>
       </m:message>
       <html>
  	     <body>
  	     	<p>The email has been successfully sent. <s:link view="/index.xhtml">Click here</s:link> to return to the index.</p>
  	     </body>
       </html>
  </ui:composition>
  
  
  1.1      date: 2007/01/21 14:41:54;  author: pmuir;  state: Exp;jboss-seam/examples/mail/view/index.html
  
  Index: index.html
  ===================================================================
  <html>
  <head>
    <meta http-equiv="Refresh" content="0; URL=index.seam" />
  </head>
  </html>
  
  
  



More information about the jboss-cvs-commits mailing list