Hi everbody,
In my project i have a user informations.These information includes file in
database.
When i want to update user information i get an error about file update.If i
choose
new image file and then update it is not problem.But i don't choose new file
and then update
it's problem.
My user UpdateTemplate.jsp file
..
<s:file id="fileId" key="form.personForm.photographName" required="false"
name="form.personForm.file" label="FILE" disabled="false" size="30"
onchange="validate()" />
..
My UserForm.java
..
private PersonForm personForm = new PersonForm();
..
My PersonForm.java
..
private Blob blobObject;
private File file ;
private String photographName;
public Person getPojoWithIds() throws IllegalAccessException,
InvocationTargetException, ParseException, FileNotFoundException,
IOException{
Person person= new Person();
BeanUtils.copyProperties(person, this);
if(getBornDateString() != null){
person.setBornDate(new
java.sql.Date(getBornDateString().getTime()));
}
Contact contact =new Contact();
contact.setId(getContactForm().getId());
person.setContact(contact);
RowStatus rowStatus = new RowStatus();
rowStatus.setId(getRowStatusForm().getId());
person.setRowStatus(rowStatus);
Language language = new Language();
language.setId(getLanguageForm().getId());
person.setLanguage(language);
if(this.getFile()!=null){
person.setBlobObject(Hibernate.createBlob(new
FileInputStream(this.getFile())));
}
return person;
}
...
I get this error.
Error Message
C:\Documents and
Settings\hilal\Desktop\yeni\eclipse_win_ganymede\projeler\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\work\Catalina\localhost\YazmanakWeb\upload__7267d08a_12277d9548c__8000_00000058.tmp
(The system cannot find the file specified)
i understand while i get information from database i can't get file so while
update <s:file> tag get a different value.I don't understand this situation.
Please help me about this problem.