가능한지 확실하지 않습니다. Excel 파일을 구문 분석하여 사용자가 내 앱 (gae)에서 다운로드하도록 허용하려고합니다.게에서 파일을 다운로드하는 방법
public class dumpDataServlet extends HttpServlet {
public void service(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String msg = "";
boolean dumpFile = false;
JSONObject json = null;
resp.setCharacterEncoding(Constant.RESPONSE_CHARACTER_ENCODING);
try {
try {
msg = req.getParameter("dumpFile") + " ";
dumpFile = Boolean.valueOf(req.getParameter("dumpFile"));
} catch (Exception ex) {
}json = getFromOtherGAE();
if (dumpFile) {
OutputStream out = resp.getOutputStream();
this.parseExcelFile(json).write(out); //parseExcelFile will return a HSSFWorkbook
out.flush();
out.close();
} else {
resp.getWriter().println(json.toString());
}
} catch (Exception ex) {
msg = ex.getClass() + " " + ex.getMessage();
resp.getWriter().println(msg);
}
}
}
이 코드에 문제가 있습니까? 아니면 개가 그것을 할 수 없습니까?
감사합니다.
죄송합니다. – vic