/** * Binds request data to this form - that is, handles form submission. * * @return a copy of this form filled with the new data */ @Override public DynamicForm bindFromRequest(String... allowedFields) { return bind(requestData(play.mvc.Controller.request()), allowedFields); }
/** * Binds request data to this form - that is, handles form submission. * * @return a copy of this form filled with the new data */ @Override public DynamicForm bindFromRequest(String... allowedFields) { return bind(requestData(play.mvc.Controller.request()), allowedFields); }
/** * Binds request data to this form - that is, handles form submission. * * @return a copy of this form filled with the new data */ public Form<T> bindFromRequest(String... allowedFields) { return bind(requestData(play.mvc.Controller.request()), allowedFields); }
/** * Binds request data to this form - that is, handles form submission. * * @return a copy of this form filled with the new data */ public Form<T> bindFromRequest(String... allowedFields) { return bind(requestData(play.mvc.Controller.request()), allowedFields); }
/** * Binds request data to this form - that is, handles form submission. * * @param allowedFields the fields that should be bound to the form, all fields if not specified. * @return a copy of this form filled with the new data * * @deprecated Deprecated as of 2.7.0. Use {@link #bindFromRequest(Http.Request, String...)} instead. */ @Deprecated public Form<T> bindFromRequest(String... allowedFields) { return bind(play.mvc.Controller.ctx().messages().lang(), play.mvc.Controller.request().attrs(), requestData(play.mvc.Controller.request()), requestFileData(play.mvc.Controller.request()), allowedFields); }
/** * Binds request data to this form - that is, handles form submission. * * @param allowedFields the fields that should be bound to the form, all fields if not specified. * @return a copy of this form filled with the new data * * @deprecated Deprecated as of 2.7.0. Use {@link #bindFromRequest(Http.Request, String...)} instead. */ @Deprecated public Form<T> bindFromRequest(String... allowedFields) { return bind(play.mvc.Controller.ctx().messages().lang(), play.mvc.Controller.request().attrs(), requestData(play.mvc.Controller.request()), requestFileData(play.mvc.Controller.request()), allowedFields); }
/** * Binds request data to this form - that is, handles form submission. * * @param allowedFields the fields that should be bound to the form, all fields if not specified. * @return a copy of this form filled with the new data * * @deprecated Deprecated as of 2.7.0. Use {@link #bindFromRequest(Http.Request, String...)} instead. */ @Deprecated public Form<T> bindFromRequest(String... allowedFields) { return bind(play.mvc.Controller.ctx().messages().lang(), play.mvc.Controller.request().attrs(), requestData(play.mvc.Controller.request()), requestFileData(play.mvc.Controller.request()), allowedFields); }
private Result uploadFile() { Http.MultipartFormData body = request().body().asMultipartFormData(); List<Http.MultipartFormData.FilePart> fileParts = body.getFiles(); if (fileParts.size() <= 0) { return badRequest("No file uploaded"); } Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); String fileName = uploadedFile.getFilename(); String contentType = uploadedFile.getContentType(); File file = uploadedFile.getFile(); try { uploadedFileLines = FileUtils.readLines(file); } catch (IOException e) { return badRequest("Could not read from uploaded file"); } return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); }
private Result postFile(String sid) { // System.out.println("POST FILE CALLED: " + sid); Http.MultipartFormData body = request().body().asMultipartFormData(); List<Http.MultipartFormData.FilePart> fileParts = body.getFiles(); if (fileParts.size() <= 0) { // System.out.println("**** NO FILE ****"); return badRequest("No file uploaded"); } Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); String fileName = uploadedFile.getFilename(); String contentType = uploadedFile.getContentType(); File file = uploadedFile.getFile(); List<String> lines; try { lines = FileUtils.readLines(file); } catch (IOException e) { // System.out.println("**** COULD NOT READ FILE ****"); return badRequest("Could not read from uploaded file"); } knownSessionIDs.put(sid, lines); return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); } }
private Result postFile(String sid) { // System.out.println("POST FILE CALLED: " + sid); Http.MultipartFormData body = request().body().asMultipartFormData(); List<Http.MultipartFormData.FilePart> fileParts = body.getFiles(); if (fileParts.size() <= 0) { // System.out.println("**** NO FILE ****"); return badRequest("No file uploaded"); } Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); String fileName = uploadedFile.getFilename(); String contentType = uploadedFile.getContentType(); File file = uploadedFile.getFile(); List<String> lines; try { lines = FileUtils.readLines(file); } catch (IOException e) { // System.out.println("**** COULD NOT READ FILE ****"); return badRequest("Could not read from uploaded file"); } knownSessionIDs.put(sid, lines); return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); } }
private Result postFile(String sid) { // System.out.println("POST FILE CALLED: " + sid); Http.MultipartFormData body = request().body().asMultipartFormData(); List<Http.MultipartFormData.FilePart> fileParts = body.getFiles(); if (fileParts.size() <= 0) { // System.out.println("**** NO FILE ****"); return badRequest("No file uploaded"); } Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); String fileName = uploadedFile.getFilename(); String contentType = uploadedFile.getContentType(); File file = uploadedFile.getFile(); List<String> lines; try { lines = FileUtils.readLines(file); } catch (IOException e) { // System.out.println("**** COULD NOT READ FILE ****"); return badRequest("Could not read from uploaded file"); } knownSessionIDs.put(sid, lines); return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); } }
private Result uploadFile() { Http.MultipartFormData body = request().body().asMultipartFormData(); List<Http.MultipartFormData.FilePart> fileParts = body.getFiles(); if (fileParts.size() <= 0) { return badRequest("No file uploaded"); } Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); String fileName = uploadedFile.getFilename(); String contentType = uploadedFile.getContentType(); File file = uploadedFile.getFile(); try { uploadedFileLines = FileUtils.readLines(file); } catch (IOException e) { return badRequest("Could not read from uploaded file"); } return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); }
private Result uploadFile() { Http.MultipartFormData body = request().body().asMultipartFormData(); List<Http.MultipartFormData.FilePart> fileParts = body.getFiles(); if (fileParts.size() <= 0) { return badRequest("No file uploaded"); } Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); String fileName = uploadedFile.getFilename(); String contentType = uploadedFile.getContentType(); File file = uploadedFile.getFile(); try { uploadedFileLines = FileUtils.readLines(file); } catch (IOException e) { return badRequest("Could not read from uploaded file"); } return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); }