Search in sources :

Example 1 with MultipartHandler

use of com.blade.mvc.handler.MultipartHandler in project blade by biezhi.

the class ServletRequest method init.

public void init() throws IOException, MultipartException {
    // retrieve multipart/form-data parameters
    if (Multipart.isMultipartContent(request)) {
        Multipart multipart = new Multipart();
        multipart.parse(request, new MultipartHandler() {

            @Override
            public void handleFormItem(String name, String value) {
                queryParams.put(name, value);
            }

            @Override
            public void handleFileItem(String name, FileItem fileItem) {
                fileItems.put(name, fileItem);
            }
        });
    }
}
Also used : FileItem(com.blade.mvc.multipart.FileItem) Multipart(com.blade.mvc.multipart.Multipart) MultipartHandler(com.blade.mvc.handler.MultipartHandler)

Aggregations

MultipartHandler (com.blade.mvc.handler.MultipartHandler)1 FileItem (com.blade.mvc.multipart.FileItem)1 Multipart (com.blade.mvc.multipart.Multipart)1