{
// Convert FALSE back into null
if (submittedValue == Boolean.FALSE)
return null;
UploadedFile file = (UploadedFile) submittedValue;
if(file.getLength() == -1)
{
FacesMessage fm = MessageFactory.getMessage(context, "org.apache.myfaces.trinidad.UPLOAD");
throw new ConverterException(fm);
}
FacesBean bean = getFacesBean(component);
Converter converter = getConverter(bean);
// support converter for the <inputFile> component
if(converter != null)
{
// create a unique key (component class name + filename) and use this
// key to add the actual uploaded file to the requestMap
String fileNameKey = component.getClass().getName() + "." + file.getFilename();
context.getExternalContext().getRequestMap().put(fileNameKey, file);
// applying the above convention. The String here is just the
// unique key which the converter has to use to look for the
// actual uploaded file.