So Far Away
Overcoming the browser upload problem
A long time ago, I actually wrote a servlet to parse a multipart http form request and handle a multi-megabyte file upload. It was miserable, because the multipart format isn't particularly well optimized to this -- if only each part had a content size, I wouldn't have had to scan the buffer every time for the end-of-part string.
It worked, but given that the browser would just sit there, not doing anything until the upload was finished, we threw it away and I wrote an FTP uplaod applet instead. That led to a whole host of new problems (applet security, versioning, plug-ins, etc.). This was a job that was just never going to make anyone happy.
In the intervening years, others have approached the problem and worked out some nice solutions that make life easier for developers with this need. The Apache Commons' File Upload project takes care of the parsing, so now all you need is a way to fix the user experience problem...
In today's Feature Article, Jacobus Steenkamp solves this side of the equation. In
Better File Uploads with AJAX and JavaServer Faces, he shows how to "take a fresh approach and implement an AJAX-powered component that will not only upload the file to the server, but also monitor the actual progress of a file upload request in 'real time.'" There's some nice server-side stuff in this approach to catch calls from the AJAX side and return just a small amount of XML, which the JavaScript can use to repaint the progress bar.
If you're planning on letting users upload large files, take a look at this approach and see what you think.
In Projects and
Communities,
the Equinox project on jini.org is an effort to
"develop a Jini-based
container for the Spring
framework. The container implementation will
transparently leverage Jini's service discovery, transaction management and
fault tolerance, and will facilitate the application's use of characteristic
features like JavaSpaces."
The Java Communications Community is featuring the paper A SEA Change towards IP Convergence (PDF) by
Rakesh Radhakrishnan, which attempts to align major industry standards Initiatives within the "Communications Media and Entertainment" (CME) industry: wireless, telco, cable, etc.
Michael Nascimento Santos says Tiger and dates don't get along in today's Weblogs:
"I've been testing a large application we have written for one of customers in Tiger and I couldn't be more disappointed by how Java 5 broke support for dates in general. If you intend to upgrade your application to Tiger or if you are using it to manipulate dates, you should be aware of these issues."
Is JSF More Performant than Action Frameworks? Jacob Hookom writes:
"Everyone assumes JSF adds overhead to application processing on the web versus something like Struts or WebWork. Reflecting on experience, I think JSF can actually be a lot faster than those solutions."
Kirill Grouchnikov relates "a story of how a commercial vendor has contributed one of its Swing components to the open-source community" in
Breadcrumb bar - from closed source to open source.
Ken Pugh's Prefactoring and Refactoring "hopes to clarify the issues" around "prefactoring", a concept that evolved from a BoF session with Pugh, Ron Jeffries, and Martin Fowler. The big difference is that "prefactoring guidelines emphasize things to think about before you start coding. Refactorings are code transformations performed after you have created code." Pugh argues this is not a matter of a "big design up front", but rather a set of guidelines to be applied before coding, in order to create better code.
As Mustang attempts to further narrow the gap between Java SE applications and native desktop applications, the SDN article Using the Desktop API in Java SE 6 (Mustang) "describes the new Desktop API, which allows Java applications to interact with the default applications associated with specific file types on the host platform. In order to describe the API more effectively, the article also features a simple application called DesktopDemo."
In today's Forums,
jada responds to a question about JUnit and Java 3D in
Re: No unit tests?:
"We did, at one point, talk about developing JUnit tests for Java 3D but decided it might be a good community project. At present, we rely on combination of test suites and programs for regression testing, such as Java 3D TCK, an inhouse Java 3D functional test suite ( that does pixel level testing ), Java 3D example programs and community testing. A JUnit test suite for Java 3D will be a great addition to have."
prunge worries about unintended consequences inRe: Null check analysis:
"If null check analysis is to be effective, all JDK classes will need to be annotated with them. Otherwise how does the compiler know that Map#get(K) can return null but Map#keySet() cannot. This is going to be a very large amount of work for the Sun people, even more than the addition of generics caused, since more classes use nulls than, say, collections. There have already been complaints that generics cause more code to be written..."
In today's java.net
News Headlines :
- Borland
Dumping JBuilder, IDE Products - Sun Releases
Security Patch for Java 2 Vulns. - Distributed
TestNG - OSWorkFlow 2.8
- Tomcat
Probe 1.0.9b-Binary - Aspose.Words
for Java
Registered users can submit news items for the
href="http://today.java.net/today/news/">java.net News Page using our
news submission
form. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the
href="http://today.java.net/pub/q/news_rss?x-ver=1.0">java.net News RSS
feed.
Current and upcoming Java
Events :
- February 11, 2006 - JUG.RU meeting in Saint-Petersburg
- February 13-17, 2006 - Entwicklertage 2006
- February 20-23, 2006 - Enterprise Java Architecture Workshop Madrid
- February 24-26, 2006 - Greater Wisconsin Software Symposium
- March 3-5, 2006 - Gateway Software Symposium
- March 6-9, 2006 - Enterprise Java Architecture Workshop Dublin
- March 6-9, 2006 - O'Reilly Emerging Technology Conference 2006
- March 10-12, 2006 - New England Software Symposium
- March 11-12, 2006 - Weekend With Experts
- March 15, 2006 - JavaUK06
- March 17, 2006 - 3rd IEEE International Workshop on Mobile Peer-to-Peer Computing (MP2P'06)
- March 17-19, 2006 - Twin Cities Software Symposium
- March 23-25, 2006 - TheServerSide Java Symposium
Registered users can submit event listings for the
href="http://www.java.net/events">java.net Events Page using our
href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
site.
Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the
href="http://today.java.net/today/archive/">java.net Archive.
Overcoming the browser upload problem
- Login or register to post comments
- Printer-friendly version
- editor's blog
- 439 reads





