package wasdev.sample.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class SimpleServlet
 */
@WebServlet("/SimpleServlet")
public class SimpleServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.getWriter().print("Hello World!");
    }

}

@@ -268,16 +268,48 @@
 esponse;
+%0Aimport javax.servlet.http.Part;
 %0A%0A/**%0A *
@@ -832,12 +832,809 @@
 );%0A    %7D
+%0A    protected void doPost(HttpServletRequest request, HttpServletResponse response)%0A%09%09%09throws ServletException, IOException %7B%0A%09%09Part part = request.getPart(%22file%22);%0A%0A%09%09String id = request.getParameter(%22id%22);%0A%09%09String name = request.getParameter(%22name%22);%0A%09%09String value = request.getParameter(%22value%22);%0A%09%09String fileName = request.getParameter(%22filename%22);%0A%0A%09%09Database db = null;%0A%09%09try %7B%0A%09%09%09db = CloudantClientMgr.getDB();%0A%09%09%7D catch (Exception re) %7B%0A%09%09%09re.printStackTrace();%0A%09%09%09response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09ResourceServlet servlet = new ResourceServlet();%0A%0A%09%09JsonObject resultObject = servlet.create(db, id, name, value, part, fileName);%0A%0A%09%09System.out.println(%22Upload completed.%22);%0A%0A%09%09response.getWriter().println(resultObject.toString());%0A%09%7D
 %0A%0A%7D%0A

Update SimpleServlet.java