I am a using struts2 file upload and my action class contains 3 private fileds with getter and setters
private File myFile;
private String myFileFileName;
private String myFileContentType;
I have some douts to clarify
We are passing only the file as parameter and bind it to the myFile, So how the application getting the file name and content type?
whenever I use myFileVariableName + "FileName" (if the file variable is myFile then file name variable is myFileFileName, if file is xxx, then file name is xxxFileName), I am getting the output, if i make any change to this format (ie,myFileVariableName + "FileName"), It getting null. Is it mandatory to use this format? Can I change it to any name I desire? If so, then how?
To get the content type, I should use jst "contentType" or myfileVariableName + "contentType". Is it also mandatory?
I assume, if I use a separate bean to store my request variables, all the parameters is bind to that bean variable. But in the case of file upload only the file variable ie, myFile in this example only get and set in the bean. fileFileName and contentType are null. If I declare these variables directly in my action class, then I get the values, but whenever I use a separate bean, only File variable can get and set, and the other two are null. Why?
If I use ModelDriven, the the same case happening, I can only get File variable and the other two variables are null. why?
I am only extending the "struts-default" in my struts.xml and no separate config for file upload, since it dont show any effect in my questions.