Search code examples
javaservletspostjeditableinline-editing

Posting to java servlet with jEditable


Is there anyone familiar with jEditable? As mentioned in the site http://www.appelsiini.net/projects/jeditable it is possible to post to a java servlet. I am unable to post and capture the value in the servlet. Also, the inline edit box does not register a change.

Script

 $('.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();
    }
} 

Solution

  • Solved! The solution was to use doPOST in the servlet.