Working with files is another common scenario for web developers. Many web applications and content management systems enable users to upload files from their desktop to a remote server. HTML includes support for file transfer through the use of a form tag with an enctype
attribute set to multipart/form-data
. By properly setting the encoding of our HTML forms, this enables the browser to send file data to a web server. The JSF HtmlForm
component also supports this behavior, and when combined with the Tomahawk HtmlInputFileUpload
component, we can add file management capabilities to our web application fairly easily.
To enable file upload with the Tomahawk library, we need to declare the MyFaces Extension Filter in our web application's configuration file (web.xml
). The Extension Filter is an important web-tier component of the Tomahawk library, and is responsible for inserting the resources needed for rendering Tomahawk UI components (such as JavaScript files and Cascading...