JSF interjects itself heavily into the form submit process, so normal J2EE file upload logic is difficult. The easiest way to do file upload in JSF is either to use one of the extension tagsets such a Apache Tomahawk, RichFaces, PrimeFaces, and so forth. An alternative is to upgrade your webapp to use JSF version 2.2 (which may require a server upgrade). In JSF 2.2 an h:fileUpload tag was finally added to the core JSF tagset.
Incidentally, here's a recommendation for coding:
The advantages are that you don't risk getting hurt by accidentally mis-matched backslashes and that your code becode less dependent on which OS you are running your webapp under.
Science is the process of replacing what we "know" with what is TRUE. Politics, alas, often prefers to be the opposite.
All that thinking. Doesn't it hurt? What do you think about this tiny ad?