Encontrando el error desde el DevFest Lima 2013
Desde le #devfestlima 2013 un desafío que llega desde la presentación donde conversamos sobre soluciones en la nube.
¿Te animas al desafío? Durante todo el día y sobre esta publicación...a demostrar el talento desarrolladores regionales
throws ServletException, IOException {
logger.log(Level.INFO, "Creando el producto");
PrintWriter out = resp.getWriter();
String category = req.getValue(“name");
String description = req.getValue(“description");
try {
Product.createOrUpdateProduct(category, description);
} catch (Exception e) {
String msg = Util.getErrorMessage(e);
out.print(msg);
}
}
Entity product = Product.getProduct(productName);
Entity item = getSingleItem(itemName);
if(item == null){
item = new Entity("Item",product.getKey());
item.setProperty("name");
item.setProperty("product");
item.setProperty("price");
}
else{
if (price != null && !"".equals(price)) {
item.setProperty("price", price);
}
}
Util.persistEntity(item);
return item;
}
¿Te animas al desafío? Durante todo el día y sobre esta publicación...a demostrar el talento desarrolladores regionales
Segmento de código 1
protected void doPut(HttpServletRequest req, HttpServletResponse resp)throws ServletException, IOException {
logger.log(Level.INFO, "Creando el producto");
PrintWriter out = resp.getWriter();
String category = req.getValue(“name");
String description = req.getValue(“description");
try {
Product.createOrUpdateProduct(category, description);
} catch (Exception e) {
String msg = Util.getErrorMessage(e);
out.print(msg);
}
}
Segmento de código 2
public static Entity createOrUpdateItem(String productName, String itemName,String price) {Entity product = Product.getProduct(productName);
Entity item = getSingleItem(itemName);
if(item == null){
item = new Entity("Item",product.getKey());
item.setProperty("name");
item.setProperty("product");
item.setProperty("price");
}
else{
if (price != null && !"".equals(price)) {
item.setProperty("price", price);
}
}
Util.persistEntity(item);
return item;
}
Comentarios
Publicar un comentario