diff --git a/spring-webflow-samples/booking-jsf/src/main/java/import.sql b/spring-webflow-samples/booking-jsf/src/main/java/import.sql index 180265a4..b0dea15c 100755 --- a/spring-webflow-samples/booking-jsf/src/main/java/import.sql +++ b/spring-webflow-samples/booking-jsf/src/main/java/import.sql @@ -1,11 +1,12 @@ -insert into Customer (username, password, name) values ('jeremy', 'barfoo', 'Jeremy Grelle') +insert into Customer (username, password, name) values ('springuser', 'barfoo', 'Spring User') insert into Customer (username, password, name) values ('demo', 'demo', 'Demo User') -insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') -insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') -insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA') -insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA') -insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA') -insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (4, 450, 'W Hotel', 'Union Square, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (5, 450, 'W Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY', '10011', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (6, 250, 'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC', '20036', 'USA') +insert into Hotel (id, price, name, address, city, state, zip, country) values (7, 300, '70 Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY', '10011', 'USA') insert into Hotel (id, price, name, address, city, state, zip, country) values (8, 300, 'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL', '33131', 'USA') insert into Hotel (id, price, name, address, city, state, zip, country) values (9, 80, 'Sea Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI', '54703', 'USA') insert into Hotel (id, price, name, address, city, state, zip, country) values (10, 90, 'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau Claire', 'WI', '54701', 'USA') diff --git a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Booking.java b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Booking.java index e642783b..ee3980f1 100755 --- a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Booking.java +++ b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Booking.java @@ -16,11 +16,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; - -//import org.hibernate.validator.Length; -//import org.hibernate.validator.NotNull; -//import org.hibernate.validator.Pattern; - @Entity public class Booking implements Serializable { private Long id; @@ -68,7 +63,6 @@ public class Booking implements Serializable { this.id = id; } - // @NotNull @Basic @Temporal(TemporalType.DATE) public Date getCheckinDate() { @@ -80,7 +74,6 @@ public class Booking implements Serializable { } @ManyToOne - // @NotNull public Hotel getHotel() { return hotel; } @@ -90,7 +83,6 @@ public class Booking implements Serializable { } @ManyToOne - // @NotNull public User getUser() { return user; } @@ -101,7 +93,6 @@ public class Booking implements Serializable { @Basic @Temporal(TemporalType.DATE) - // @NotNull public Date getCheckoutDate() { return checkoutDate; } @@ -110,9 +101,6 @@ public class Booking implements Serializable { this.checkoutDate = checkoutDate; } - // @NotNull(message="Credit card number is required") - // @Length(min=16, max=16, message="Credit card number must 16 digits long") - // @Pattern(regex="^\\d*$", message="Credit card number must be numeric") public String getCreditCard() { return creditCard; } @@ -144,8 +132,6 @@ public class Booking implements Serializable { this.beds = beds; } - // @NotNull(message="Credit card name is required") - // @Length(min=3, max=70, message="Credit card name is required") public String getCreditCardName() { return creditCardName; } diff --git a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Hotel.java b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Hotel.java index e6800add..4b4dcd12 100755 --- a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Hotel.java +++ b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/Hotel.java @@ -8,9 +8,6 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -//import org.hibernate.validator.Length; -//import org.hibernate.validator.NotNull; - @Entity public class Hotel implements Serializable { private Long id; @@ -32,7 +29,6 @@ public class Hotel implements Serializable { this.id = id; } - // @Length(max=50) @NotNull public String getName() { return name; } @@ -41,7 +37,6 @@ public class Hotel implements Serializable { this.name = name; } - // @Length(max=100) @NotNull public String getAddress() { return address; } @@ -50,7 +45,6 @@ public class Hotel implements Serializable { this.address = address; } - // @Length(max=40) @NotNull public String getCity() { return city; } @@ -59,7 +53,6 @@ public class Hotel implements Serializable { this.city = city; } - // @Length(min=4, max=6) @NotNull public String getZip() { return zip; } @@ -68,7 +61,6 @@ public class Hotel implements Serializable { this.zip = zip; } - // @Length(min=2, max=10) @NotNull public String getState() { return state; } @@ -77,7 +69,6 @@ public class Hotel implements Serializable { this.state = state; } - // @Length(min=2, max=40) @NotNull public String getCountry() { return country; } diff --git a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/User.java b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/User.java index e7c0d04c..cc4f0078 100755 --- a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/User.java +++ b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/model/User.java @@ -6,10 +6,6 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -//import org.hibernate.validator.Length; -//import org.hibernate.validator.NotNull; -//import org.hibernate.validator.Pattern; - @Entity @Table(name = "Customer") public class User implements Serializable { @@ -26,8 +22,6 @@ public class User implements Serializable { public User() { } - // @NotNull - // @Length(max = 100) public String getName() { return name; } @@ -36,8 +30,6 @@ public class User implements Serializable { this.name = name; } - // @NotNull - // @Length(min = 5, max = 15) public String getPassword() { return password; } @@ -47,8 +39,6 @@ public class User implements Serializable { } @Id - // @Length(min = 5, max = 15) - // @Pattern(regex = "^\\w*$", message = "not a valid username") public String getUsername() { return username; } diff --git a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/service/services-config-jpa.xml b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/service/services-config-jpa.xml index 126f0c91..42d5f2cc 100755 --- a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/service/services-config-jpa.xml +++ b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/service/services-config-jpa.xml @@ -13,7 +13,7 @@ - + diff --git a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/util/DebuggingPhaseListener.java b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/util/DebuggingPhaseListener.java index c3ae80d7..43cd27e8 100644 --- a/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/util/DebuggingPhaseListener.java +++ b/spring-webflow-samples/booking-jsf/src/main/java/org/springframework/webflow/samples/booking/util/DebuggingPhaseListener.java @@ -1,5 +1,8 @@ package org.springframework.webflow.samples.booking.util; +import java.util.Map; + +import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; @@ -21,6 +24,12 @@ public class DebuggingPhaseListener implements PhaseListener { public void beforePhase(PhaseEvent event) { if (logger.isDebugEnabled()) { logger.debug("Entering JSF Phase: " + event.getPhaseId()); + + if (event.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES) { + Map input = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); + for (Object key : input.keySet()) + logger.debug(key + " : " + input.get(key)); + } } } diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/WEB-INF/webflow-config.xml b/spring-webflow-samples/booking-jsf/src/main/webapp/WEB-INF/webflow-config.xml index f0365bbd..40c26b0d 100755 --- a/spring-webflow-samples/booking-jsf/src/main/webapp/WEB-INF/webflow-config.xml +++ b/spring-webflow-samples/booking-jsf/src/main/webapp/WEB-INF/webflow-config.xml @@ -15,9 +15,9 @@ - + - + diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/css/screen.css b/spring-webflow-samples/booking-jsf/src/main/webapp/css/screen.css index 5c18b0b6..0c65e65f 100755 --- a/spring-webflow-samples/booking-jsf/src/main/webapp/css/screen.css +++ b/spring-webflow-samples/booking-jsf/src/main/webapp/css/screen.css @@ -8,7 +8,7 @@ body, div, dd, dt, dl, img, ul, ol, li, p, h1, h2, h3, h4, h5, form, hr, fieldse ----------------------------------------------- */ html { height: 100%; - background-color: #DBD4C6; + background-color: #9cac7c; } img { border: 0; @@ -59,18 +59,25 @@ fieldset { #header { float: left; width: 758px; - height:76px; - background: url(../images/hdr.bg.gif) 0 0 repeat-x; + height:36px; + background-color: #414f23; } #container { float: left; width: 758px; - background: url(../images/spring-logo.jpg) 0 0 repeat-x; + background: url(../images/header.graphic.jpg) 0 0 repeat-x; +} +#sidebar { + float: left; + width: 205px; + margin-left: 5px; + margin-top: 185px; + padding-top: 5px; } #content { float: left; - width: 548px; - margin-top: 75px; + width: 448px; + margin-top: 195px; padding-top: 5px; background: #fff url(../img/cnt.bg.gif) 0 0 repeat-x; } @@ -170,7 +177,7 @@ input[type="submit"], input[type="button"] { #content .section { float: left; width: 518px; - padding: 15px 15px 0 15px; + padding: 15px 15px 0 3px; } #content .section h1 { font-family: "Trebuchet MS", Arial, sans-serif; @@ -225,14 +232,22 @@ input[type="submit"], input[type="button"] { border-left: 0px; border-bottom: 0px; } +#content .section .prev { + float: left; + width: 120px; +} +#content .section .next { + float: left; +} /* Header ----------------------------------------------- */ #title { float: left; - padding: 1px 0 6px 15px; + padding: 10px 0 6px 15px; + color: #e9efdb; } #status { - color: #C7B299; + color: #e9efdb; float: right; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; @@ -242,6 +257,6 @@ input[type="submit"], input[type="button"] { padding-right: 15px; } #status a { - color: #C7B299; + color: #e9efdb; text-decoration: none; } diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/flows/booking/book.xhtml b/spring-webflow-samples/booking-jsf/src/main/webapp/flows/booking/book.xhtml index 15e4c7ee..fc1eb4b7 100755 --- a/spring-webflow-samples/booking-jsf/src/main/webapp/flows/booking/book.xhtml +++ b/spring-webflow-samples/booking-jsf/src/main/webapp/flows/booking/book.xhtml @@ -4,6 +4,7 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a="https://ajax4jsf.dev.java.net/ajax" + xmlns:sf="http://springframework.org/faces" template="/template.xhtml"> @@ -13,7 +14,7 @@
- +
Name:
@@ -49,29 +50,22 @@
Check In Date:
- - - - - - - - + + + + +
Check Out Date:
- - - - - - - - - + + + + +
@@ -103,22 +97,19 @@
Credit Card #:
- - - - - + + +
Credit Card Name:
- - - - - + + +
@@ -154,14 +145,15 @@
-
 
-   + + +  
-
+
diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/flows/main/main.xhtml b/spring-webflow-samples/booking-jsf/src/main/webapp/flows/main/main.xhtml index cb430a79..ade80858 100755 --- a/spring-webflow-samples/booking-jsf/src/main/webapp/flows/main/main.xhtml +++ b/spring-webflow-samples/booking-jsf/src/main/webapp/flows/main/main.xhtml @@ -13,7 +13,7 @@ - +

Search Hotels

@@ -65,10 +65,14 @@ - - + +
diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/images/btn.bg.gif b/spring-webflow-samples/booking-jsf/src/main/webapp/images/btn.bg.gif index 133e2ee9..b77cc954 100755 Binary files a/spring-webflow-samples/booking-jsf/src/main/webapp/images/btn.bg.gif and b/spring-webflow-samples/booking-jsf/src/main/webapp/images/btn.bg.gif differ diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/images/diplomat.jpg b/spring-webflow-samples/booking-jsf/src/main/webapp/images/diplomat.jpg new file mode 100644 index 00000000..e1d0c9cd Binary files /dev/null and b/spring-webflow-samples/booking-jsf/src/main/webapp/images/diplomat.jpg differ diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/images/hdr.bg.gif b/spring-webflow-samples/booking-jsf/src/main/webapp/images/hdr.bg.gif deleted file mode 100755 index 71fa194c..00000000 Binary files a/spring-webflow-samples/booking-jsf/src/main/webapp/images/hdr.bg.gif and /dev/null differ diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/images/header.graphic.jpg b/spring-webflow-samples/booking-jsf/src/main/webapp/images/header.graphic.jpg new file mode 100644 index 00000000..ce170222 Binary files /dev/null and b/spring-webflow-samples/booking-jsf/src/main/webapp/images/header.graphic.jpg differ diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/images/tse.gif b/spring-webflow-samples/booking-jsf/src/main/webapp/images/tse.gif new file mode 100644 index 00000000..b1fa98cf Binary files /dev/null and b/spring-webflow-samples/booking-jsf/src/main/webapp/images/tse.gif differ diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/intro.xhtml b/spring-webflow-samples/booking-jsf/src/main/webapp/intro.xhtml index c7f980a3..fa80785a 100755 --- a/spring-webflow-samples/booking-jsf/src/main/webapp/intro.xhtml +++ b/spring-webflow-samples/booking-jsf/src/main/webapp/intro.xhtml @@ -1,22 +1,55 @@ - + + + Spring Web Stack: SWF + JSF Booking Sample + + + - -
Booking SWF + JSF - A Spring Web Flow Sample
-
-
-

- - - -

+
+ -
- - - +
+ + + +
+
+

Welcome to the Spring Web Flow Booking Sample

+ +

+ This sample will continue to evolve as Spring Web Flow 2.0 is developed. +

+ +

+ As of SWF 2.0-m1, some of the new features that this sample serves to demonstrate include: +

  • Flow-scoped persistence contexts
  • +
  • Unified EL integration
  • +
  • Spring 2.0 custom scopes
  • +
  • Client-side validation support
  • +

    + +

    + Click here to book your hotel. +

    +
    +
    +
    + +
    + \ No newline at end of file diff --git a/spring-webflow-samples/booking-jsf/src/main/webapp/template.xhtml b/spring-webflow-samples/booking-jsf/src/main/webapp/template.xhtml index 157598dc..f17e9bc4 100644 --- a/spring-webflow-samples/booking-jsf/src/main/webapp/template.xhtml +++ b/spring-webflow-samples/booking-jsf/src/main/webapp/template.xhtml @@ -6,17 +6,30 @@ Spring Web Stack: SWF + JSF Booking Sample +