You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by cb...@apache.org on 2005/03/22 07:08:18 UTC
svn commit: r158546 - in incubator/ibatis/trunk/java:
jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/
jpetstore/jpetstore4/src/com/ibatis/struts/
jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/
jpetstore/jpetstore4/src/org/ jpetstore/jpetstore4/src/org/apache/
jpetstore/jpetstore4/src/properties/ jpetstore/jpetstore4/web/WEB-INF/
mapper/mapper2/build/
Author: cbegin
Date: Mon Mar 21 22:08:12 2005
New Revision: 158546
URL: http://svn.apache.org/viewcvs?view=rev&rev=158546
Log:
Added validatoractionform instead of validatE() method
Added:
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AbstractBean.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/org/
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/org/apache/
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/properties/messages.properties
incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validation.xml
incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validator-rules.xml
Removed:
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/ActionContext.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/BaseBean.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/BeanAction.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/BeanActionException.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/ApplicationMap.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/BaseHttpMap.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/CookieMap.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/ParameterMap.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/RequestMap.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/struts/httpmap/SessionMap.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/properties/application.properties
Modified:
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AccountBean.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CartBean.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CatalogBean.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/OrderBean.java
incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/struts-config.xml
incubator/ibatis/trunk/java/mapper/mapper2/build/version.properties
Added: incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AbstractBean.java
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AbstractBean.java?view=auto&rev=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AbstractBean.java (added)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AbstractBean.java Mon Mar 21 22:08:12 2005
@@ -0,0 +1,19 @@
+package com.ibatis.jpetstore.presentation;
+
+import org.apache.struts.beanaction.ActionContext;
+import org.apache.struts.beanaction.BaseBean;
+
+public abstract class AbstractBean extends BaseBean {
+
+ public static final String SUCCESS = "success";
+ public static final String FAILURE = "failure";
+ public static final String SIGNON = "signon";
+ public static final String SHIPPING = "shipping";
+ public static final String CONFIRM = "confirm";
+
+ protected void setMessage(String value) {
+ ActionContext.getActionContext().getRequestMap().put("message", value);
+ }
+
+
+}
Modified: incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AccountBean.java
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AccountBean.java?view=diff&r1=158545&r2=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AccountBean.java (original)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/AccountBean.java Mon Mar 21 22:08:12 2005
@@ -4,29 +4,26 @@
import com.ibatis.jpetstore.domain.Account;
import com.ibatis.jpetstore.service.AccountService;
import com.ibatis.jpetstore.service.CatalogService;
-import com.ibatis.struts.ActionContext;
-import com.ibatis.struts.BaseBean;
-import com.ibatis.struts.BeanActionException;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
-public class AccountBean extends BaseBean {
+import org.apache.struts.beanaction.BeanActionException;
+import org.apache.struts.beanaction.ActionContext;
- /* Constants */
-
- private static final AccountService accountService = AccountService.getInstance();
- private static final CatalogService catalogService = CatalogService.getInstance();
+public class AccountBean extends AbstractBean {
- private static final String VALIDATE_NEW_ACCOUNT = "new";
- private static final String VALIDATE_EDIT_ACCOUNT = "edit";
+ /* Constants */
private static final List LANGUAGE_LIST;
private static final List CATEGORY_LIST;
/* Private Fields */
+ private AccountService accountService;
+ private CatalogService catalogService;
+
private Account account;
private String repeatedPassword;
private String pageDirection;
@@ -55,6 +52,8 @@
public AccountBean() {
account = new Account();
+ accountService = AccountService.getInstance();
+ catalogService = CatalogService.getInstance();
}
/* JavaBeans Properties */
@@ -133,7 +132,7 @@
myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
authenticated = true;
repeatedPassword = null;
- return "success";
+ return SUCCESS;
} catch (Exception e) {
throw new BeanActionException ("There was a problem creating your Account Information. Cause: " + e, e);
}
@@ -142,7 +141,7 @@
public String editAccountForm() {
try {
account = accountService.getAccount(account.getUsername());
- return "success";
+ return SUCCESS;
} catch (Exception e) {
throw new BeanActionException ("There was a problem retrieving your Account Information. Cause: "+e, e);
}
@@ -153,7 +152,7 @@
accountService.updateAccount(account);
account = accountService.getAccount(account.getUsername());
myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
- return "success";
+ return SUCCESS;
} catch (Exception e) {
throw new BeanActionException ("There was a problem updating your Account Information. Cause: "+e, e);
}
@@ -165,7 +164,7 @@
} else if ("previous".equals(pageDirection)) {
myList.previousPage();
}
- return "success";
+ return SUCCESS;
}
public String signon() {
@@ -173,9 +172,10 @@
account = accountService.getAccount(account.getUsername(), account.getPassword());
if (account == null || account == null) {
- ActionContext.getActionContext().setSimpleMessage("Invalid username or password. Signon failed.");
+ String value = "Invalid username or password. Signon failed.";
+ setMessage(value);
clear();
- return "failure";
+ return FAILURE;
} else {
account.setPassword(null);
@@ -183,14 +183,14 @@
authenticated = true;
- return "success";
+ return SUCCESS;
}
}
public String signoff() {
ActionContext.getActionContext().getRequest().getSession().invalidate();
clear();
- return "success";
+ return SUCCESS;
}
public boolean isAuthenticated() {
@@ -210,36 +210,6 @@
pageDirection = null;
myList = null;
authenticated = false;
- }
-
- public void validate() {
- ActionContext ctx = ActionContext.getActionContext();
- if (validation != null) {
- if (VALIDATE_EDIT_ACCOUNT.equals(validation) || VALIDATE_NEW_ACCOUNT.equals(validation)) {
- if (VALIDATE_NEW_ACCOUNT.equals(validation)) {
- account.setStatus("OK");
- validateRequiredField(account.getUsername(), "User ID is required.");
- if (account.getPassword() == null || account.getPassword().length() < 1 || !account.getPassword().equals(repeatedPassword)) {
- ctx.addSimpleError("Passwords did not match or were not provided. Matching passwords are required.");
- }
- }
- if (account.getPassword() != null && account.getPassword().length() > 0) {
- if (!account.getPassword().equals(repeatedPassword)) {
- ctx.addSimpleError("Passwords did not match.");
- }
- }
- validateRequiredField(account.getFirstName(), "First name is required.");
- validateRequiredField(account.getLastName(), "Last name is required.");
- validateRequiredField(account.getEmail(), "Email address is required.");
- validateRequiredField(account.getPhone(), "Phone number is required.");
- validateRequiredField(account.getAddress1(), "Address (1) is required.");
- validateRequiredField(account.getCity(), "City is required.");
- validateRequiredField(account.getState(), "State is required.");
- validateRequiredField(account.getZip(), "ZIP is required.");
- validateRequiredField(account.getCountry(), "Country is required.");
- }
- }
-
}
}
Modified: incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CartBean.java
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CartBean.java?view=diff&r1=158545&r2=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CartBean.java (original)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CartBean.java Mon Mar 21 22:08:12 2005
@@ -4,24 +4,28 @@
import com.ibatis.jpetstore.domain.CartItem;
import com.ibatis.jpetstore.domain.Item;
import com.ibatis.jpetstore.service.CatalogService;
-import com.ibatis.struts.ActionContext;
-import com.ibatis.struts.BaseBean;
import java.util.Iterator;
import java.util.Map;
-public class CartBean extends BaseBean {
+import org.apache.struts.beanaction.ActionContext;
- /* Constants */
-
- private static final CatalogService catalogService = CatalogService.getInstance();
+public class CartBean extends AbstractBean {
/* Private Fields */
+ private CatalogService catalogService;
+
private Cart cart = new Cart();
private String workingItemId;
private String pageDirection;
+ /* Constructors */
+
+ public CartBean() {
+ catalogService = CatalogService.getInstance();
+ }
+
/* JavaBeans Properties */
public Cart getCart() {
@@ -62,7 +66,7 @@
cart.addItem(item, isInStock);
}
- return "success";
+ return SUCCESS;
}
public String removeItemFromCart() {
@@ -70,10 +74,10 @@
Item item = cart.removeItemById(workingItemId);
if (item == null) {
- ActionContext.getActionContext().setSimpleMessage("Attempted to remove null CartItem from Cart.");
- return "failure";
+ setMessage("Attempted to remove null CartItem from Cart.");
+ return FAILURE;
} else {
- return "success";
+ return SUCCESS;
}
}
@@ -95,7 +99,7 @@
}
}
- return "success";
+ return SUCCESS;
}
public String switchCartPage() {
@@ -104,11 +108,11 @@
} else if ("previous".equals(pageDirection)) {
cart.getCartItemList().previousPage();
}
- return "success";
+ return SUCCESS;
}
public String viewCart() {
- return "success";
+ return SUCCESS;
}
public void clear() {
Modified: incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CatalogBean.java
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CatalogBean.java?view=diff&r1=158545&r2=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CatalogBean.java (original)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/CatalogBean.java Mon Mar 21 22:08:12 2005
@@ -5,8 +5,6 @@
import com.ibatis.jpetstore.domain.Item;
import com.ibatis.jpetstore.domain.Product;
import com.ibatis.jpetstore.service.CatalogService;
-import com.ibatis.struts.ActionContext;
-import com.ibatis.struts.BaseBean;
/**
* <p/>
@@ -14,14 +12,12 @@
*
* @author Clinton Begin
*/
-public class CatalogBean extends BaseBean {
-
- /* Constants */
-
- private static final CatalogService catalogService = CatalogService.getInstance();
+public class CatalogBean extends AbstractBean {
/* Private Fields */
+ private CatalogService catalogService;
+
private String keyword;
private String pageDirection;
@@ -37,6 +33,12 @@
private Item item;
private PaginatedList itemList;
+ /* Constructors */
+
+ public CatalogBean() {
+ catalogService = CatalogService.getInstance();
+ }
+
/* JavaBeans Properties */
public String getKeyword() {
@@ -134,16 +136,16 @@
productList = catalogService.getProductListByCategory(categoryId);
category = catalogService.getCategory(categoryId);
}
- return "success";
+ return SUCCESS;
}
public String searchProducts() {
if (keyword == null || keyword.length() < 1) {
- ActionContext.getActionContext().setSimpleMessage("Please enter a keyword to search for, then press the search button.");
- return "failure";
+ setMessage("Please enter a keyword to search for, then press the search button.");
+ return FAILURE;
} else {
productList = catalogService.searchProductList(keyword.toLowerCase());
- return "success";
+ return SUCCESS;
}
}
@@ -153,7 +155,7 @@
} else if ("previous".equals(pageDirection)) {
productList.previousPage();
}
- return "success";
+ return SUCCESS;
}
public String viewProduct() {
@@ -161,7 +163,7 @@
itemList = catalogService.getItemListByProduct(productId);
product = catalogService.getProduct(productId);
}
- return "success";
+ return SUCCESS;
}
public String switchItemListPage() {
@@ -170,13 +172,13 @@
} else if ("previous".equals(pageDirection)) {
itemList.previousPage();
}
- return "success";
+ return SUCCESS;
}
public String viewItem() {
item = catalogService.getItem(itemId);
product = item.getProduct();
- return "success";
+ return SUCCESS;
}
public void clear () {
Modified: incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/OrderBean.java
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/OrderBean.java?view=diff&r1=158545&r2=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/OrderBean.java (original)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/com/ibatis/jpetstore/presentation/OrderBean.java Mon Mar 21 22:08:12 2005
@@ -4,8 +4,6 @@
import com.ibatis.jpetstore.domain.Order;
import com.ibatis.jpetstore.service.AccountService;
import com.ibatis.jpetstore.service.OrderService;
-import com.ibatis.struts.ActionContext;
-import com.ibatis.struts.BaseBean;
import com.ibatis.common.util.PaginatedList;
import java.util.ArrayList;
@@ -13,17 +11,19 @@
import java.util.Map;
import java.util.Collections;
-public class OrderBean extends BaseBean {
+import org.apache.struts.beanaction.ActionContext;
- /* Constants */
+public class OrderBean extends AbstractBean {
- private static final AccountService accountService = AccountService.getInstance();
- private static final OrderService orderService = OrderService.getInstance();
+ /* Constants */
private static final List CARD_TYPE_LIST;
/* Private Fields */
+ private AccountService accountService;
+ private OrderService orderService;
+
private Order order;
private int orderId;
private boolean shippingAddressRequired;
@@ -44,9 +44,11 @@
/* Constructors */
public OrderBean() {
- this.order = new Order();
- this.shippingAddressRequired = false;
- this.confirmed = false;
+ order = new Order();
+ shippingAddressRequired = false;
+ confirmed = false;
+ accountService = AccountService.getInstance();
+ orderService = OrderService.getInstance();
}
/* JavaBeans Properties */
@@ -108,16 +110,16 @@
clear();
if (accountBean == null || !accountBean.isAuthenticated()){
- ActionContext.getActionContext().setSimpleMessage("You must sign on before attempting to check out. Please sign on and try checking out again.");
- return "signon";
+ setMessage("You must sign on before attempting to check out. Please sign on and try checking out again.");
+ return SIGNON;
} else if (cartBean != null) {
// Re-read account from DB at team's request.
Account account = accountService.getAccount(accountBean.getAccount().getUsername());
order.initOrder(account, cartBean.getCart());
- return "success";
+ return SUCCESS;
} else {
- ActionContext.getActionContext().setSimpleMessage("An order could not be created because a cart could not be found.");
- return "failure";
+ setMessage("An order could not be created because a cart could not be found.");
+ return FAILURE;
}
}
@@ -126,9 +128,9 @@
if (shippingAddressRequired) {
shippingAddressRequired = false;
- return "shipping";
+ return SHIPPING;
} else if (!isConfirmed()) {
- return "confirm";
+ return CONFIRM;
} else if (getOrder() != null) {
orderService.insertOrder(order);
@@ -136,12 +138,12 @@
CartBean cartBean = (CartBean)sessionMap.get("cartBean");
cartBean.clear();
- ActionContext.getActionContext().setSimpleMessage("Thank you, your order has been submitted.");
+ setMessage("Thank you, your order has been submitted.");
- return "success";
+ return SUCCESS;
} else {
- ActionContext.getActionContext().setSimpleMessage("An error occurred processing your order (order was null).");
- return "failure";
+ setMessage("An error occurred processing your order (order was null).");
+ return FAILURE;
}
}
@@ -149,7 +151,7 @@
Map sessionMap = ActionContext.getActionContext().getSessionMap();
AccountBean accountBean = (AccountBean) sessionMap.get("accountBean");
orderList = orderService.getOrdersByUsername(accountBean.getAccount().getUsername());
- return "success";
+ return SUCCESS;
}
public String switchOrderPage() {
@@ -158,7 +160,7 @@
} else if ("previous".equals(pageDirection)) {
orderList.previousPage();
}
- return "success";
+ return SUCCESS;
}
@@ -169,11 +171,11 @@
order = orderService.getOrder(orderId);
if (accountBean.getAccount().getUsername().equals(order.getUsername())) {
- return "success";
+ return SUCCESS;
} else {
order = null;
- ActionContext.getActionContext().setSimpleMessage("You may only view your own orders.");
- return "failure";
+ setMessage("You may only view your own orders.");
+ return FAILURE;
}
}
@@ -188,44 +190,6 @@
confirmed = false;
orderList = null;
pageDirection = null;
- }
-
- public void validate() {
- ActionContext ctx = ActionContext.getActionContext();
-
- if (!this.isShippingAddressRequired()) {
- validateRequiredField(order.getCreditCard(), "FAKE (!) credit card number required.");
- validateRequiredField(order.getExpiryDate(), "Expiry date is required.");
- validateRequiredField(order.getCardType(), "Card type is required.");
-
- validateRequiredField(order.getShipToFirstName(), "Shipping Info: first name is required.");
- validateRequiredField(order.getShipToLastName(), "Shipping Info: last name is required.");
- validateRequiredField(order.getShipAddress1(), "Shipping Info: address is required.");
- validateRequiredField(order.getShipCity(), "Shipping Info: city is required.");
- validateRequiredField(order.getShipState(), "Shipping Info: state is required.");
- validateRequiredField(order.getShipZip(), "Shipping Info: zip/postal code is required.");
- validateRequiredField(order.getShipCountry(), "Shipping Info: country is required.");
-
- validateRequiredField(order.getBillToFirstName(), "Billing Info: first name is required.");
- validateRequiredField(order.getBillToLastName(), "Billing Info: last name is required.");
- validateRequiredField(order.getBillAddress1(), "Billing Info: address is required.");
- validateRequiredField(order.getBillCity(), "Billing Info: city is required.");
- validateRequiredField(order.getBillState(), "Billing Info: state is required.");
- validateRequiredField(order.getBillZip(), "Billing Info: zip/postal code is required.");
- validateRequiredField(order.getBillCountry(), "Billing Info: country is required.");
- }
-
- if (ctx.isSimpleErrorsExist()) {
- order.setBillAddress1(order.getShipAddress1());
- order.setBillAddress2(order.getShipAddress2());
- order.setBillToFirstName(order.getShipToFirstName());
- order.setBillToLastName(order.getShipToLastName());
- order.setBillCity(order.getShipCity());
- order.setBillCountry(order.getShipCountry());
- order.setBillState(order.getShipState());
- order.setBillZip(order.getShipZip());
- }
-
}
}
Added: incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/properties/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/properties/messages.properties?view=auto&rev=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/properties/messages.properties (added)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/src/properties/messages.properties Mon Mar 21 22:08:12 2005
@@ -0,0 +1,63 @@
+####################################
+# Typical Struts Resources File
+####################################
+
+account.username.label=Username
+account.password.label=Password
+account.repeatPassword.label=Repeat password
+account.firstName.label=First name
+account.lastName.label=Last name
+account.email.label=Email address
+account.phone.label=Phone
+account.address1.label=Address
+account.city.label=City
+account.state.label=State
+account.zip.label=Zip/Postal Code
+account.country.label=Country
+order.creditCard.label=FAKE (!) credit card number
+order.expiryDate.label=Expiry date
+order.cardType.label=Card type
+account.shipToFirstName.label=Shipping Info: first name
+account.shipToLastName.label=Shipping Info: last name
+account.shipAddress1.label=Shipping Info: address
+account.shipCity.label=Shipping Info: city
+account.shipState.label=Shipping Info: state
+account.shipZip.label=Shipping Info: zip/postal code
+account.shipCountry.label=Shipping Info: country
+account.billToFirstName.label=Billing Info: first name
+account.billToLastName.label=Billing Info: last name
+account.billAddress1.label=Billing Info: address
+account.billCity.label=Billing Info: city
+account.billState.label=Billing Info: state
+account.billZip.label=Billing Info: zip/postal code
+account.billCountry.label=Billing Info: country
+
+# -- standard errors --
+errors.header=<UL>
+errors.prefix=<LI>
+errors.suffix=</LI>
+errors.footer=</UL>
+# -- validator --
+errors.invalid={0} is invalid.
+errors.maxlength={0} can not be greater than {1} characters.
+errors.minlength={0} can not be less than {1} characters.
+errors.range={0} is not in the range {1} through {2}.
+errors.required={0} is required.
+errors.byte={0} must be an byte.
+errors.date={0} is not a date.
+errors.double={0} must be an double.
+errors.float={0} must be an float.
+errors.integer={0} must be an integer.
+errors.long={0} must be an long.
+errors.short={0} must be an short.
+errors.creditcard={0} is not a valid credit card number.
+errors.email={0} is an invalid e-mail address.
+# -- other --
+errors.cancel=Operation cancelled.
+errors.detail={0}
+errors.general=The process did not complete. Details should follow.
+errors.token=Request could not be completed. Operation is not in sequence.
+# -- welcome --
+welcome.title=Struts Blank Application
+welcome.heading=Welcome!
+welcome.message=To get started on your own application, copy the struts-blank.war to a new WAR file using the name for your application. Place it in your container's "webapp" folder (or equivalent), and let your container auto-deploy the application. Edit the skeleton configuration files as needed, restart your container, and you are on your way! (You can find the application.properties file with this message in the /WEB-INF/src/java/resources folder.)
Modified: incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/struts-config.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/struts-config.xml?view=diff&r1=158545&r2=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/struts-config.xml (original)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/struts-config.xml Mon Mar 21 22:08:12 2005
@@ -197,6 +197,12 @@
</action-mappings>
- <message-resources parameter="properties.application"/>
+ <message-resources parameter="properties.messages"/>
+
+ <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+ <set-property
+ property="pathnames"
+ value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
+ </plug-in>
</struts-config>
Added: incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validation.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validation.xml?view=auto&rev=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validation.xml (added)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validation.xml Mon Mar 21 22:08:12 2005
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+
+<form-validation>
+
+ <formset>
+
+ <form name="/shop/newAccount">
+ <field
+ property="account.username"
+ depends="required">
+ <arg key="account.username.label"/>
+ </field>
+ <field
+ property="account.password"
+ depends="required">
+ <arg key="account.password.label"/>
+ </field>
+ <field
+ property="repeatPassword"
+ depends="required">
+ <arg key="account.repeatPassword.label"/>
+ </field>
+ <field
+ property="account.firstName"
+ depends="required">
+ <arg key="account.firstName.label"/>
+ </field>
+ <field
+ property="account.lastName"
+ depends="required">
+ <arg key="account.lastName.label"/>
+ </field>
+ <field
+ property="account.email"
+ depends="required">
+ <arg key="account.email.label"/>
+ </field>
+ <field
+ property="account.phone"
+ depends="required">
+ <arg key="account.phone.label"/>
+ </field>
+ <field
+ property="account.address1"
+ depends="required">
+ <arg key="account.address1.label"/>
+ </field>
+ <field
+ property="account.city"
+ depends="required">
+ <arg key="account.city.label"/>
+ </field>
+ <field
+ property="account.state"
+ depends="required">
+ <arg key="account.state.label"/>
+ </field>
+ <field
+ property="account.zip"
+ depends="required">
+ <arg key="account.zip.label"/>
+ </field>
+ <field
+ property="account.country"
+ depends="required">
+ <arg key="account.country.label"/>
+ </field>
+ </form>
+
+ <form name="/shop/editAccount">
+ <field
+ property="account.firstName"
+ depends="required">
+ <arg key="account.firstName.label"/>
+ </field>
+ <field
+ property="account.lastName"
+ depends="required">
+ <arg key="account.lastName.label"/>
+ </field>
+ <field
+ property="account.email"
+ depends="required">
+ <arg key="account.email.label"/>
+ </field>
+ <field
+ property="account.phone"
+ depends="required">
+ <arg key="account.phone.label"/>
+ </field>
+ <field
+ property="account.address1"
+ depends="required">
+ <arg key="account.address1.label"/>
+ </field>
+ <field
+ property="account.city"
+ depends="required">
+ <arg key="account.city.label"/>
+ </field>
+ <field
+ property="account.state"
+ depends="required">
+ <arg key="account.state.label"/>
+ </field>
+ <field
+ property="account.zip"
+ depends="required">
+ <arg key="account.zip.label"/>
+ </field>
+ <field
+ property="account.country"
+ depends="required">
+ <arg key="account.country.label"/>
+ </field>
+ </form>
+
+ <form name="/shop/newOrder">
+ <field
+ property="order.creditCard"
+ depends="required">
+ <arg key="order.creditCard.label"/>
+ </field>
+ <field
+ property="order.expiryDate"
+ depends="required">
+ <arg key="order.expiryDate.label"/>
+ </field>
+ <field
+ property="order.cardType"
+ depends="required">
+ <arg key="order.cardType.label"/>
+ </field>
+ <field
+ property="account.shipToFirstName"
+ depends="required">
+ <arg key="account.shipToFirstName.label"/>
+ </field>
+ <field
+ property="account.shipToLastName"
+ depends="required">
+ <arg key="account.shipToLastName.label"/>
+ </field>
+ <field
+ property="account.shipAddress1"
+ depends="required">
+ <arg key="account.shipAddress1.label"/>
+ </field>
+ <field
+ property="account.shipCity"
+ depends="required">
+ <arg key="account.shipCity.label"/>
+ </field>
+ <field
+ property="account.shipState"
+ depends="required">
+ <arg key="account.shipState.label"/>
+ </field>
+ <field
+ property="account.shipZip"
+ depends="required">
+ <arg key="account.shipZip.label"/>
+ </field>
+ <field
+ property="account.shipCountry"
+ depends="required">
+ <arg key="account.shipCountry.label"/>
+ </field>
+ <field
+ property="account.billToFirstName"
+ depends="required">
+ <arg key="account.billToFirstName.label"/>
+ </field>
+ <field
+ property="account.billToLastName"
+ depends="required">
+ <arg key="account.billToLastName.label"/>
+ </field>
+ <field
+ property="account.billAddress1"
+ depends="required">
+ <arg key="account.billAddress1.label"/>
+ </field>
+ <field
+ property="account.billCity"
+ depends="required">
+ <arg key="account.billCity.label"/>
+ </field>
+ <field
+ property="account.billState"
+ depends="required">
+ <arg key="account.billState.label"/>
+ </field>
+ <field
+ property="account.billZip"
+ depends="required">
+ <arg key="account.billZip.label"/>
+ </field>
+ <field
+ property="account.billCountry"
+ depends="required">
+ <arg key="account.billCountry.label"/>
+ </field>
+
+ </form>
+
+ </formset>
+
+</form-validation>
Added: incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validator-rules.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validator-rules.xml?view=auto&rev=158546
==============================================================================
--- incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validator-rules.xml (added)
+++ incubator/ibatis/trunk/java/jpetstore/jpetstore4/web/WEB-INF/validator-rules.xml Mon Mar 21 22:08:12 2005
@@ -0,0 +1,287 @@
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+<!--
+ $Header: /home/cbegin/aforge/aforge/web/WEB-INF/validator-rules.xml,v 1.1 2005/01/26 16:16:20 begin Exp $
+ $Revision: 1.1 $
+ $Date: 2005/01/26 16:16:20 $
+
+ This file contains the default Struts Validator pluggable validator
+ definitions. It should be placed somewhere under /WEB-INF and
+ referenced in the struts-config.xml under the plug-in element
+ for the ValidatorPlugIn.
+
+ <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+ <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+ /WEB-INF/validation.xml"/>
+ </plug-in>
+
+ These are the default error messages associated with
+ each validator defined in this file. They should be
+ added to your projects ApplicationResources.properties
+ file or you can associate new ones by modifying the
+ pluggable validators msg attributes in this file.
+
+ # Struts Validator Error Messages
+ errors.required={0} is required.
+ errors.minlength={0} can not be less than {1} characters.
+ errors.maxlength={0} can not be greater than {1} characters.
+ errors.invalid={0} is invalid.
+
+ errors.byte={0} must be a byte.
+ errors.short={0} must be a short.
+ errors.integer={0} must be an integer.
+ errors.long={0} must be a long.
+ errors.float={0} must be a float.
+ errors.double={0} must be a double.
+
+ errors.date={0} is not a date.
+ errors.range={0} is not in the range {1} through {2}.
+ errors.creditcard={0} is an invalid credit card number.
+ errors.email={0} is an invalid e-mail address.
+
+ Note: Starting in Struts 1.2.0 the default javascript definitions have
+ been consolidated to commons-validator. The default can be overridden
+ by supplying a <javascript> element with a CDATA section, just as
+ in struts 1.1.
+
+-->
+
+<form-validation>
+
+ <global>
+
+ <validator name="required"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateRequired"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ msg="errors.required"/>
+
+ <validator name="requiredif"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateRequiredIf"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ org.apache.commons.validator.Validator,
+ javax.servlet.http.HttpServletRequest"
+ msg="errors.required"/>
+
+ <validator name="validwhen"
+ msg="errors.required"
+ classname="org.apache.struts.validator.validwhen.ValidWhen"
+ method="validateValidWhen"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ org.apache.commons.validator.Validator,
+ javax.servlet.http.HttpServletRequest"/>
+
+
+ <validator name="minlength"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMinLength"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.minlength"
+ jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>
+
+
+ <validator name="maxlength"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMaxLength"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.maxlength"
+ jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>
+
+
+
+ <validator name="mask"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMask"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.invalid"/>
+
+
+ <validator name="byte"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateByte"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.byte"
+ jsFunctionName="ByteValidations"/>
+
+
+ <validator name="short"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateShort"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.short"
+ jsFunctionName="ShortValidations"/>
+
+
+ <validator name="integer"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateInteger"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.integer"
+ jsFunctionName="IntegerValidations"/>
+
+
+
+ <validator name="long"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateLong"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.long"/>
+
+
+ <validator name="float"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateFloat"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.float"
+ jsFunctionName="FloatValidations"/>
+
+ <validator name="double"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateDouble"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.double"/>
+
+
+ <validator name="date"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateDate"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.date"
+ jsFunctionName="DateValidations"/>
+
+
+ <validator name="intRange"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateIntRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="integer"
+ msg="errors.range"/>
+
+
+ <validator name="floatRange"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateFloatRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="float"
+ msg="errors.range"/>
+
+
+ <validator name="creditCard"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateCreditCard"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.creditcard"/>
+
+
+ <validator name="email"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateEmail"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.email"/>
+
+ <validator name="url"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateUrl"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.url"/>
+
+ <!--
+ This simply allows struts to include the validateUtilities into a page, it should
+ not be used as a validation rule.
+ -->
+ <validator name="includeJavaScriptUtilities"
+ classname=""
+ method=""
+ methodParams=""
+ depends=""
+ msg=""
+ jsFunction="org.apache.commons.validator.javascript.validateUtilities"/>
+
+ </global>
+
+</form-validation>
Modified: incubator/ibatis/trunk/java/mapper/mapper2/build/version.properties
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/java/mapper/mapper2/build/version.properties?view=diff&r1=158545&r2=158546
==============================================================================
--- incubator/ibatis/trunk/java/mapper/mapper2/build/version.properties (original)
+++ incubator/ibatis/trunk/java/mapper/mapper2/build/version.properties Mon Mar 21 22:08:12 2005
@@ -1,4 +1,4 @@
#Build version info
-#Sun Mar 13 09:16:46 MST 2005
-buildDate=2005/03/13 09\:16
-buildNum=553
+#Tue Mar 15 20:20:29 MST 2005
+buildDate=2005/03/15 20\:20
+buildNum=554