public org.apache.struts.action.ActionForward | execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
ProductForm productForm = (ProductForm)form;
String productName = productForm.getProductName();
Product product = ProductManager.getProduct(productName);
ProductManager.setImagePath(getFilePath());
productForm.setDescription(product.getDescription());
productForm.setFilename(product.getFilename());
productForm.setPrice(product.getPrice());
productForm.setImagePath(getFilePath()+"/"+product.getFilename());
productForm.setProductId(product.getProductId());
Properties properties = new Properties();
FileInputStream in = null;
String dir = properties.getProperty("products.directory");
return mapping.findForward("success");
|