I am using Spring Frame work 3.05 and i wanted download files using same framework.After googling i found answer in this stack overflow link .
Downloading a file from spring controllers
in the above link -> Scott Carlson - Answer
But if i try to do as suggested in the above link. I am getting following Error :
" Error while writing to output stream due to :java.io.NotSerializableException: org.springframework.core.io.FileSystemResource "
My code looks Like :
FileSystemResource fsr = new FileSystemResource(path); try { OutputStream outstr = res.getOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(outstr); oos.writeObject(fsr); oos.flush(); oos.close(); } catch(Exception e) { log4log.error("Error while writing to output stream due to :"+e.toString()); return null; } Please Help me out...