Map<Object, Object> root = new HashMap<Object, Object>();
root.putAll(super.root);
Template temp = getConfiguration().getTemplate("product/ProductDetail.ftl");
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
String id = request.getParameter("id");
long lid = -1;
try {
lid = Long.parseLong(id);
} catch (Exception e1) {
lid = -1;
}
Product product = gatewayService.findProductById(lid);
if(product!=null) {
root.put("product", product);
root.put("Product_List_Url", Constants.PRODUCT_LIST_URL);
List<Brand> brands = gatewayService.findBrand();
if(brands!=null&&brands.size()>0) {
root.put("brands", brands);
}
List<ProductProperty> colorSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYCOLOR);
if(colorSelect!=null&&colorSelect.size()>0) {
root.put("colorSelect", colorSelect);
}
List<ProductProperty> coltheSizeSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYCLOTHESIZE);
if(coltheSizeSelect!=null&&coltheSizeSelect.size()>0) {
root.put("coltheSizeSelect", coltheSizeSelect);
}
List<ProductProperty> shoeSizeSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYSHOESIZE);
if(shoeSizeSelect!=null&&shoeSizeSelect.size()>0) {
root.put("shoeSizeSelect", shoeSizeSelect);
}
List<FareWay> farewaySelect = gatewayService.findFare();
if(farewaySelect!=null&&farewaySelect.size()>0) {
root.put("farewaySelect", farewaySelect);
}
List<IPObject> iPObjects = gatewayService.findAllIPObject();
root.put("iPObjects", iPObjects);
String color = product.getColor();
String[] colors = color.split(";");
Map<String, String> colorMap = new HashMap<String, String>();