Posts tagged download
One of the brand new specifications in Java EE 7 is JSR-352 Batch Applications for the Java Platform. This specification describes how Java EE containers will allow applications to run batch jobs in a standardized way. Such a batch job can be scheduled (to be started by the container) or be started as a background process (for example from a Web applications or EJB).
In this article I will show a simple download manager that is implemented using this new Batch specification. The user will enter a number of URLs of files that should be downloaded and gathered into a single ZIP-file. An HTML page submits the list of files to a Servlet. The Servlet starts a batch job (that runs in the background) and returns to the browser with the identifier of the background job. The batch job meanwhile will go through a number of steps: create a temporary directory, download all files, create a zip-file, add all downloaded files to the archive and finally remove the temporary download directory.
This example will show a number of the mechanisms and features of the JSR-352 specification, including chunked processing, parameter passing, batchlets, job and step listeners, the creation of the JSL More >
Especially if the first page in the web application does not really use all that much richness to begin with. It is not uncommon to have a homepage that is largely static, pretty and heavily styled through CSS with perhaps a global search item, a couple of navigation links or buttons and maybe some newsfeeds or special offers. Or to start the application with a fairly simple login page.
This article describes how to reduce the (initial) download size More >