пока моя попытка
вот часть jsp
<h:form id="fileUploader" enctype="multipart/form-data" target="upload_target" >
<h:panelGrid columns="4" width="100%">
<t:inputFileUpload id="file" value="#{FIleuploadservlet.uploadedFile}" required="true" />
<h:commandButton value="Submit" actionListener="#{FIleuploadservlet.uploadDirect}" onclick="setFormAction();" />
</h:panelGrid>
управляемый компонент ...
public void uploadDirect(ActionEvent ae)
{
HttpServletRequest request=(HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
HttpSession session=request.getSession();
try
{
byte[] data = new byte[(int) uploadedFile.getSize()];
uploadedFile.getInputStream().read(data, 0, (int) uploadedFile.getSize());
System.out.println("savefile===="+uploadedFile.getName());
File file=new File("c:\\file");
if(!file.exists())
{
file.mkdirs();
}
FileOutputStream fileOut = new FileOutputStream("c:\\file\\lantern.avi");
fileOut.write(data, 0, data.length);
fileOut.flush();
fileOut.close();
}catch(Exception e)
{
e.printStackTrace();
}
}