Index: jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/java/com/sun/faces/regression/i_gf_16654/UserBean.java =================================================================== --- jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/java/com/sun/faces/regression/i_gf_16654/UserBean.java (revision 0) +++ jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/java/com/sun/faces/regression/i_gf_16654/UserBean.java (revision 0) @@ -0,0 +1,89 @@ +package com.sun.faces.regression.i_gf_16654; + +import java.util.Date; +import javax.faces.application.FacesMessage; +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.validator.ValidatorException; + +@ManagedBean +@SessionScoped +public class UserBean { + + protected String firstName; + protected String lastName; + protected Date dob; + protected String sex; + protected String email; + protected String serviceLevel = "medium"; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Date getDob() { + return dob; + } + + public void setDob(Date dob) { + this.dob = dob; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getServiceLevel() { + return serviceLevel; + } + + public void setServiceLevel(String serviceLevel) { + this.serviceLevel = serviceLevel; + } + + public void validateEmail(FacesContext context, UIComponent toValidate, + Object value) throws ValidatorException { + String emailStr = (String) value; + if (-1 == emailStr.indexOf("@")) { + FacesMessage message = new FacesMessage("Invalid email address"); + throw new ValidatorException(message); + } + } + + public String addConfirmedUser() { + // This method would call a database or other service and add the + // confirmed user information. + // For now, we just place an informative message in request scope + FacesMessage doneMessage = + new FacesMessage("Successfully added new user"); + FacesContext.getCurrentInstance().addMessage(null, doneMessage); + return "done"; + } +} + Index: jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/webapp/main.xhtml =================================================================== --- jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/webapp/main.xhtml (revision 0) +++ jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/webapp/main.xhtml (revision 0) @@ -0,0 +1,13 @@ + + + + A Simple JavaServer Faces 2.0 View + + + +

+
+
+ Index: jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/webapp/WEB-INF/web.xml =================================================================== --- jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/webapp/WEB-INF/web.xml (revision 0) +++ jsf-test/GLASSFISH-16654/i_gf_16654_war/src/main/webapp/WEB-INF/web.xml (revision 0) @@ -0,0 +1,39 @@ + + + + + mojarra-regression-test + A simple regression test to make it easier to get your bug fixed. The only reason we need a web.xml is to set the PROJECT_STAGE to Develoment. If you have a web.xml, then you need to map the FacesServlet. + + + + Tell the runtime where we are in the project development + lifecycle. Valid values are: + Development, UnitTest, SystemTest, or Production. + The runtime will display helpful hints to correct common mistakes + when the value is Development. + + javax.faces.PROJECT_STAGE + Development + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + Faces Servlet + /faces/* + + + + faces/main.xhtml + + + Index: jsf-test/GLASSFISH-16654/i_gf_16654_war/pom.xml =================================================================== --- jsf-test/GLASSFISH-16654/i_gf_16654_war/pom.xml (revision 0) +++ jsf-test/GLASSFISH-16654/i_gf_16654_war/pom.xml (revision 0) @@ -0,0 +1,45 @@ + + + 4.0.0 + + com.sun.faces.regression.i_gf_16654 + i_gf_16654_war + 1.0 + war + ${project.artifactId} + + ${project.artifactId} + + + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + + javax.faces + jsf-api + 2.1 + provided + + + javax + javaee-api + 6.0 + provided + + + + + + java.net-maven2-repository + Java.net Repository for Maven + http://download.java.net/maven/2/ + default + + + Index: jsf-test/GLASSFISH-16654/build.xml =================================================================== --- jsf-test/GLASSFISH-16654/build.xml (revision 0) +++ jsf-test/GLASSFISH-16654/build.xml (revision 0) @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +