Atomic Multiple File Upload via JSF Session Map
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional Web applications lack the ability to select and upload multiple files atomically, view upload status, and cancel individual uploads, due to limitations in existing Java Server Faces (JSF) frameworks which only support single or sequential multiple-file uploads, failing to handle file size limitations effectively.
Innovation Solution
A modified web component, af:inputFile(multiple), is introduced that enables the selection and upload of multiple files, displays upload status, and allows cancellation of individual uploads, storing files in a session map until a submit message is received, ensuring atomicity by processing all files in a single Java Server Faces lifecycle after successful upload.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If multiple files are uploaded sequentially using existing JSF frameworks, then individual file upload cancellation is enabled, but atomic upload of all files together cannot be achieved
Solution Approach 1:
The upload component is segmented into distinct functional modules: file selection interface, individual file upload controllers, status monitoring system, and atomic submission handler. Each module handles specific aspects of the upload process independently, allowing complex multiple-file atomic uploads to be managed through coordinated simple components.
Solution Approach 2:
An intermediary session map mechanism is introduced between the client and server to temporarily store uploaded files before final processing. This mediator holds files in a pending state, allowing the system to accumulate multiple files and process them atomically only after all files are successfully uploaded and the user confirms submission.
2Ease of operation
If conventional form submit is used for file uploads, then implementation is simple, but file size limitations cannot be exceeded and individual cancellation is not enabled
Solution Approach 1:
The upload component implements dynamic behavior where the upload process can be paused, resumed, or cancelled for individual files based on user action. The component transitions between different states (selecting, uploading, completed, cancelled) and allows flexible control during the upload process, making it adaptable to user needs while maintaining a relatively simple interface.
3Productivity
If multiple files are uploaded without atomic processing, then upload process can start immediately, but unpredictable network delays cause files to be processed at different times
Solution Approach 1:
The system performs preliminary actions by uploading all files to a temporary holding area (session map) before final processing. During this preliminary phase, files are transferred to the server but not yet processed by the business logic. Only after all files are successfully uploaded and the user submits the form does the system proceed with the actual processing, ensuring all files are available simultaneously for consistent processing.
Data Source
AI summary
An atomic multiple-file upload from a client to a server requires only a single Java Server Faces (JSF) lifecycle to process the multiple files uploaded. Progress and other upload status indicators are displayed at the client and individual files can be deleted, canceled or added prior to committing the multiple-file upload at the server.


