Long id = Long.parseLong(req.getParameter(Parameters.PRODUCT_ID.getId()));
l.info("edit product "+id);
Product p = service.getById(id);
try {
String action = req.getParameter(Parameters.PRODUCT_ACTION.getId());
if (action.equals("Update Product")) {
Double price = Double.parseDouble(req.getParameter(Parameters.PRODUCT_PRICE.getId()));
p.setPrice(price);
String description = req.getParameter(Parameters.PRODUCT_DESC.getId());
p.setDescription(description);
String onSale = req.getParameter(Parameters.ON_SALE.getId());
if (onSale != null && onSale.equals("on")) {
p.setSaleInd("T");
}
else {
p.setSaleInd("F");
}
String active = req.getParameter(Parameters.ON_SALE.getId());
p.setActive(active != null && active.equals("on"));
fs.setForm(FormName.EDIT_PRODUCT);
}
else if (action.equals("")) {