- - - Duplicate submit of the same transaction not allowed! - -
-- Sell a new item -
-diff --git a/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java b/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java
index 84f0937a..baafe632 100644
--- a/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java
+++ b/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/InMemoryDatabaseCreator.java
@@ -21,7 +21,9 @@ public class InMemoryDatabaseCreator extends JdbcDaoSupport {
@Override
protected void initDao() throws Exception {
- String createSales = "create table T_SALES (ID int not null identity primary key, ITEM_COUNT int not null, PRICE double NOT NULL, category VARCHAR(1) NOT NULL, SHIPPING_TYPE varchar(1))";
+ String createSales =
+ "create table T_SALES (ID int not null identity primary key, ITEM_COUNT int not null, " +
+ "PRICE double NOT NULL, category VARCHAR(1) NOT NULL, SHIPPING_TYPE varchar(1))";
getJdbcTemplate().execute(createSales);
}
diff --git a/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java b/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java
index c3e245ec..b0506d87 100644
--- a/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java
+++ b/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/JdbcSaleProcessor.java
@@ -18,6 +18,7 @@ package org.springframework.webflow.samples.sellitem;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
public class JdbcSaleProcessor extends JdbcDaoSupport implements SaleProcessor {
+
public void process(Sale sale) {
getJdbcTemplate()
.update("insert into T_SALES values (?, ?, ?, ?, ?)",
diff --git a/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/SaleValidator.java b/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/SaleValidator.java
index 0966cab0..f6878952 100644
--- a/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/SaleValidator.java
+++ b/spring-webflow-samples/sellitem-jsf/src/main/java/org/springframework/webflow/samples/sellitem/SaleValidator.java
@@ -30,9 +30,8 @@ public class SaleValidator implements Validator {
}
public void validatePriceAndItemCount(Sale sale, Errors errors) {
- // the next two items are normallhy more appropriately handled by JSF
- // field
- // validation. We'll leave them here for safety
+ // the next two items are normally more appropriately handled by JSF
+ // field validation. We'll leave them here for safety
if (sale.getItemCount() <= 0) {
errors.rejectValue("itemCount", "tooLittle", "Item count must be greater than 0");
}
@@ -40,11 +39,9 @@ public class SaleValidator implements Validator {
errors.rejectValue("price", "tooLittle", "Price must be greater than 0.0");
}
- // perhaps an artificial example, but we want to show that in the JSF
- // integration
+ // perhaps an artificial example, but we want to show that in the JSF integration
// validators are best used for validation of field relationships.
- // Individual fields
- // are better validated with simple JSF field validation
+ // Individual fields are better validated with simple JSF field validation
if (sale.getItemCount() * sale.getPrice() > 1000000)
errors.reject("saleTooLarge", "total dollar value for sale above allowed limit");
}
diff --git a/spring-webflow-samples/sellitem-jsf/src/main/webapp/WEB-INF/faces-config.xml b/spring-webflow-samples/sellitem-jsf/src/main/webapp/WEB-INF/faces-config.xml
index 0b31b305..5ea0a83d 100644
--- a/spring-webflow-samples/sellitem-jsf/src/main/webapp/WEB-INF/faces-config.xml
+++ b/spring-webflow-samples/sellitem-jsf/src/main/webapp/WEB-INF/faces-config.xml
@@ -26,7 +26,7 @@