Announcement Announcement Module
Collapse
No announcement yet.
File download in swf-booking-faces project Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • File download in swf-booking-faces project

    Hello all,

    Would anyone help us with how to implement the download function in the swf-booking-faces project in SWF 2.0.8 and Spring 3.0? We have a null-transition in the flow where we evaluate the following service:

    Code:
    public void showDocument{...}
    	HttpServletResponse response = (HttpServletResponse) requestContext.getExternalContext().getNativeResponse();
    	response.reset();
    	response.setCharacterEncoding("UTF-8");
    	response.setContentType(getFileContentType());		
    	response.setHeader("Content-disposition", "attachment; filename=\"" + getOriginalFileName() +"\"");
    	response.setContentLength(getFileContent().length);
    	response.setHeader("Pragma", "public");
    	response.setHeader("Cache-control", "private");
    	try {				            
    		ServletOutputStream sos = response.getOutputStream();	
    		sos.write(getFileContent());
    		sos.flush();
    		requestContext.getExternalContext().recordResponseComplete();	
    	}
    }
    The service run successfully, however, the download dialog is not displayed on the client side.

    Any help would be appreciated.

    Thanks,

    Fanta
    Last edited by fantabk; Mar 25th, 2010, 01:29 PM.
Working...
X