try {
stock = Integer.parseInt(g_stock);
// stock = Integer.valueOf(g_stock);
if (stock < 0) {
throw new Exception();
}
} catch (Exception e) {
request.setAttribute("error", "商品库存必须是大于0的整数");
request.getRequestDispatcher("/edit.jsp").forward(request, response);
return;
}