[jboss-cvs] jboss-seam/examples/mail/src/org/jboss/seam/example/mail ...
Peter Muir
peter at bleepbleep.org.uk
Mon Feb 5 17:33:54 EST 2007
User: pmuir
Date: 07/02/05 17:33:54
Modified: examples/mail/src/org/jboss/seam/example/mail Person.java
MailExample.java
Log:
oops
Revision Changes Path
1.3 +37 -3 jboss-seam/examples/mail/src/org/jboss/seam/example/mail/Person.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Person.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/mail/src/org/jboss/seam/example/mail/Person.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- Person.java 4 Feb 2007 20:58:27 -0000 1.2
+++ Person.java 5 Feb 2007 22:33:54 -0000 1.3
@@ -1,14 +1,17 @@
package org.jboss.seam.example.mail;
-import java.io.InputStream;
-
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.util.Resources;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
@Name("person")
@Scope(ScopeType.CONVERSATION)
public class Person
@@ -16,6 +19,7 @@
private String firstname;
private String lastname;
private String address;
+ private InputStream photo = Resources.getResourceAsStream("/no_image.png");
@Create
@Begin(join=true)
@@ -24,6 +28,35 @@
}
+ @Factory("people")
+ public List<Person> getPeople() {
+ List<Person> people = new ArrayList<Person>();
+ people.add(new Person("Gavin", "King", "gavin.king at jboss.com", "/gavin.jpg"));
+ people.add(new Person("Shane", "Bryzak", "shane.bryzak at jboss.com", "/shane.jpg"));
+ return people;
+ }
+
+ public Person()
+ {
+ }
+
+
+
+ public Person(String firstname, String lastname, String address, String photoPath)
+ {
+ this.firstname = firstname;
+ this.lastname = lastname;
+ this.address = address;
+ this.photo = Resources.getResourceAsStream(photoPath);
+ }
+
+ public Person(String firstname, String lastname, String address)
+ {
+ this.firstname = firstname;
+ this.lastname = lastname;
+ this.address = address;
+ }
+
public String getAddress()
{
return address;
@@ -50,7 +83,8 @@
}
public InputStream getPhoto() {
- return Resources.getResourceAsStream("/no_image.png");
+ return photo;
}
+
}
1.5 +1 -0 jboss-seam/examples/mail/src/org/jboss/seam/example/mail/MailExample.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MailExample.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/examples/mail/src/org/jboss/seam/example/mail/MailExample.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- MailExample.java 4 Feb 2007 20:58:27 -0000 1.4
+++ MailExample.java 5 Feb 2007 22:33:54 -0000 1.5
@@ -2,6 +2,7 @@
import java.net.URL;
+import java.util.List;
import javax.faces.application.FacesMessage;
More information about the jboss-cvs-commits
mailing list