有人熟悉jEditable吗?如现场所述http://www.appelsiini.net/projects/jeditable发布到javaservlet是可能的。我无法在servlet中发布和捕获值。此外,内联编辑框不会注册更改。
编写脚本
$('.edit').editable('update.do');
HTML
<div class="edit" id="example">edit here</div>
Java Servlet
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();
}
}
已解决!解决方案是在servlet中使用doPOST。