myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tathagat <>
Subject File attachment - view state couldn't be restored, reload?
Date Wed, 20 Jun 2007 15:28:38 GMT
Hi all.
In my JSF application I have a link (t:commandLink) on click of which I want
to send an attachment to the user. The usual way in struts was

response.setHeader ("Content-Disposition","attachment;filename=\"mae.csv\
response.getOutputStream().write(file.getBytes()); // file is some object
which return bytes

When I do this in JSF, I also do in the end:

Works fine - But after I have the file, I try to do something else (Another
action), I get the error:
*View state couldn't be restored, reload?*
I guess it is because JSF loses the view (for some reason I don't know).

What is the right way to send an attachment to user with *PURE JSF*solution.

I read in some places about using shale, servlets, etc.. But I want a pure
JSF solution. Help, anyone?

Thanks in advance.


View raw message