后台判断参数是否是某个类型

xiaoxiao2021-02-27  149

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; }
转载请注明原文地址: https://www.6miu.com/read-9387.html

最新回复(0)