コード例 #1
0
ファイル: CalljavaServlet.java プロジェクト: sorako/kotemaru
  public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    httpRequestContext.set(new HttpRequestContext(this, req, resp));

    try {
      String ctype = req.getContentType();
      if (ctype != null) ctype = ctype.toLowerCase();
      if (FileUpload.isMultipartContent(req)) {
        callMethodForMultiPart(req, resp);
      } else if (MIME_JSON.equals(ctype)) {
        // TODO: json-rpc
      } else {
        callMethodForParam(req, resp);
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new ServletException(e);
    }
  }