}
public boolean validateUpdateQty(ShoppingCartActionForm form, ContentBean contentBean) throws Exception {
boolean hasError = false;
String itemQtys[] = form.getItemQtys();
Language language = contentBean.getContentSessionBean().getSiteProfile().getSiteProfileClass().getLanguage();
if (itemQtys != null) {
for (int i = 0; i < itemQtys.length; i++) {
ShoppingCartItemBean itemInfo = (ShoppingCartItemBean) form.getShoppingCartItemInfos().elementAt(i);
if (itemQtys[i].trim().length() == 0) {
continue;
}
if (!Format.isInt(itemQtys[i])) {
hasError = true;
String value = Languages.getLangTranValue(language.getLangId(), "content.error.int.invalid");
itemInfo.setItemQtyError(value);
}
else {
int intValue = Format.getInt(itemQtys[i]);
if (intValue < 0) {
hasError = true;
String value = Languages.getLangTranValue(language.getLangId(), "content.error.int.invalid");
itemInfo.setItemQtyError(value);
}
}
}
}