java 空指针问题Caused by: java.lang.NullPointerException

JSP

JSP

//修改的方法
    function editProduct() {
        var selectedRows = $("#dg").datagrid('getSelections');
        if (selectedRows.length != 1) {
            $.messager.alert("系统提示", "请选择一条要编辑的数据!");
            return;
        }
        var row = selectedRows[0];
        $("#w").dialog("open").dialog("setTitle", "编辑商品信息");
        $("#ff").form("load", row);
        url = "${pageContext.request.contextPath}/ProductServlet?method=Edit_P&pid=" + row.pid;

    }
    //保存
    function save() {
        $("#ff").form("submit", {
            url : url,
            success : function(result) {
                if (result.errorMsg) {
                    $.messager.alert("系统提示", result.errorMsg);
                    return;
                } else {
                    $.messager.alert("系统提示", "保存成功");
                    $("#w").dialog("close");
                    $("#dg").datagrid("reload");
                }
            }
        });
    }


//update
    public String Edit_P(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        Product p = MyBeanUtils.populate(Product.class, req.getParameterMap());
        ProductService productService = new ProductServiceImpl();

        productService.edit(p);

        return "/admin/product/list.jsp";
    }
查看全部
a19892213
a19892213
2019/04/17 22:19
  • ajax
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复