• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem after export data and Navigation.  RSS feed

 
M Madrane
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am trying to navigate after an export data from JSF. For that I use response.getOutPutStream() which works good (the export works),
but here after this, JSF lost the navigation (when I click on "h:commandLink" or "h:commandButton" to do other Action ...). I think that my data and my " <t:saveState id="xxxManagerBean" value="xxxManagerBean"> " are lost .


code for export:


public void exportFile() {
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response =
(HttpServletResponse)context.getExternalContext().getResponse();
response.setContentType("application/pdf");
response.setHeader("Content-disposition",
"inline=filename=file.pdf");

try {
response.getOutputStream().write(yourdata[]);
response.getOutputStream().flush();
response.getOutputStream().close();
context.responseComplete();
} catch (IOException e) {
e.printStackTrace();
}
}


Perhaps, this problem is caused by "context.responseComplete();" or the saveState lost data when I work white response !!!.


There is the same problem whith the "<h:commandLink target="myNewPage"/>", I lost my navigation.


Thanks in Advance.

M MADRANE
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!