0

有谁熟悉 jEditable 吗?正如网站http://www.appelsiini.net/projects/jeditable中提到的,可以发布到 java servlet。我无法发布和捕获 servlet 中的值。此外,内联编辑框不会注册更改。

脚本

 $('.edit').editable('update.do');

HTML

<div class="edit" id="example">edit here</div>

Java 小服务程序

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    try {
        String name=  request.getParameter("id");
        String value=  request.getParameter("value");
        System.out.println("Name is " + name);
        System.out.println("Value is " + value);
        //Nothing is printed out, no change is registered in the inline edit box

    } finally { 
        out.close();
    }
} 
4

1 回答 1

0

解决了!解决方案是在 servlet 中使用 doPOST。

于 2011-06-16T03:07:25.243 回答