File Download « IceFaces « JSF Q&A





1. Download File from server that uses Icefaces form based authentication    stackoverflow.com

I am a newbie to ICEfaces and i have a requirement where i need to download a document from a given url (http://ipaddress/formexec?objectid=201). This URL uses a form based authentication that ...

2. What causes a "Cannot register a null resource" error in ICEfaces?    stackoverflow.com

Java EE 5, JSF 1.2 with Facelets, ICEfaces 1.8.2 What can cause a "Cannot register a null resource" error in ICEfaces, using an ice:outputResource tag? From the ICEfaces source code, it looks ...

3. While running a application from Netbeans , it directing me to download the code file?    stackoverflow.com

Am working with netbeans and icefaces , there is no error in the program . when am running the program , instead of displaying the output its simply giving me the ...

4. File Download problem using icefaces    coderanch.com

Hi, I am using icefaces with liferay and am trying to download a file( it should open up the download dialogue box) from DB using the attached code. I have a command link on the webpage and currently if I click on that link, the method gets called, the inputstream is not null, but on the browser nothing happens. public void ...

5. Corrupted ZIP files upon download    icefaces.org

On my home station it doesn't work neither with Firefox 3 nor with IE7. The successful download was with Firefox 2 on the other network. The I brough the files home and the same ZIP software was able to open them successfully. It seems the corrupted files were a few bytes shorter

6. File Download    icefaces.org

7. How to download a file from an ICEfaces application    icefaces.org

Hi all, I want to be able to download a generated pdf file from an ICEfaces application. As I do not want to shown the full pathname of the file to the user for security reason, I have found this very interesting link: http://balusc.blogspot.com/2006/05/pdf-handling.html Within a woodstock application, from a button action this code works perfectly. The browser asks me where ...

8. downloading files    icefaces.org

9. File download issues...    icefaces.org





11. Problems with downloading file commandLink    icefaces.org

Hi people, I develope a web application and want to add a component, which I can download an excel file. I tried with different components but without success: - outputLink - outputResource - CommandLink - CommandButton I want that appears a window with "Save as ...". In my Bean I can create already the excel file and store it in a ...

12. How to achieve file download function?    icefaces.org

public class FileDownloadServlet extends HttpServlet { private String downloadPath; private final String FILE_NOT_FOUND = "/error.jsp"; @Override protected void doGet(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException { String fileName = req.getParameter("fileName"); response.setHeader("Cache-Control", "no-cache"); response.setContentType("application/vnd.ms-excel"); DataInputStream is = null; DataOutputStream os = null; try { response.setHeader("Content-Disposition", "attachment; filename=" + "aa.rar"); File uploadedFile = new File(downloadPath + "aa.rar"); is = new DataInputStream(new FileInputStream(uploadedFile)); os ...

13. Tree component and download file    icefaces.org

15. [Custom Servlet] File download from my application    icefaces.org

package it.uniroma2.pms.utility; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URLDecoder; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class FileServlet extends HttpServlet { private static final int DEFAULT_BUFFER_SIZE = 10240; // 10KB. private String filePath; public void init() throws ServletException { this.filePath = "/PMS/upload/fatture"; } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException ...





19. Download Temporal File    icefaces.org

Hi i want to download a temporal file xml or zip file, i call goToOfficeExportconfig from web page public void goToOfficeExportconfig(ActionEvent actionEvent) { FacesContext facesContext = FacesContext.getCurrentInstance(); Map params = facesContext.getExternalContext().getRequestParameterMap(); try { String value = "Text of my xml"; File file = generateTempFile("name", "xml", value); download(file); } catch (Exception e) { e.printStackTrace(); } } public void download(File file) throws IOException ...

20. XML file download problem    icefaces.org

public void exportConfiguration() { FacesContext context = FacesContext.getCurrentInstance(); HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse(); String nameUploadedFile = "configuration"; response.setContentType("application/xhtml+xml"); response.setHeader("Content-Disposition", "attachment;filename=\"" + nameUploadedFile + XMLConfigurationUtil.getDateTime() + ".xml\""); OutputStream os = null; try { os = response.getOutputStream(); IOUtils.write(configurationString, os); } catch (IOException ex) { Logger.getLogger(ConfigurationController.class.getName()).log(Level.SEVERE, null, ex); } finally { IOUtils.closeQuietly(os); FacesContext.getCurrentInstance().responseComplete(); } } protected HttpServletResponse getResponse() { return (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); }

22. Dealing with File Download    icefaces.org

23. file download servlet problem in IE    icefaces.org

Hello. In my application I have some reports which generates in ReportServlet and can be saved/opened by clicking on specific button. In my actionListener method I put some parameters into session and call javascript which starts ReportServlet in new window: String javascriptCode = "window.open('report');"; JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(), javascriptCode); In my servlet I do some calculations and then do smth. like it: PrintWriter out ...

24. ICEfaces freezes GUI during file downloading.    icefaces.org

@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); if (session == null || !request.isRequestedSessionIdValid()) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); response.flushBuffer(); return; } Lifecycle.setPhaseId(PhaseId.INVOKE_APPLICATION); Lifecycle.setServletRequest(request); Lifecycle.beginRequest(getServletContext(), session, request); Manager.instance().restoreConversation(request.getParameterMap()); Lifecycle.resumeConversation(session); Manager.instance().handleConversationPropagation(request.getParameterMap()); try { doWork(request, response); // TODO: conversation timeout Manager.instance().endRequest(ContextAdaptor.getSession(session)); Lifecycle.endRequest(session); } catch (Exception e) { logger.error(e.toString()); Manager.instance().endRequest(ContextAdaptor.getSession(session)); Lifecycle.endRequest(); throw new ServletException(e.getMessage(), e); } finally { Lifecycle.setServletRequest(null); Lifecycle.setPhaseId(null); ...

25. problem to download file in icefaces    icefaces.org

26. How to implement a File Download    icefaces.org

Hi there, I got a problem implementing a file download in my application. So I read some threads and I think there are three ways to implement a File Download: 1. Use HttpServletResponse in backing bean This is not able with ICEfaces, since it uses AJAX. Because you can't use HttpServletResponse there is only the possibility to write a custom servlet ...

27. Download file (even with servlet) freezes components on page    icefaces.org

I created an icefaces popup in which I display an ice:outputLink and two commandButtons with value "yes" and "no". The idea is that the user clicks "yes" when the file download was successfull (after clicking the download link and saving the file) . In that case the user is returned to a certain page and some processing occurs. If the user ...

28. Download File and Acegi Authentication    icefaces.org

I want to download a txt file from server. Since there is no explicit solution in icefaces related to download file, so i developed a separated download servlet and used value as address of download servlet in outputlink. I also mentioned target as "_blank" to save the halt of my page. It perfectly works and downloads it. I am also using ...

29. File Download Still no solution    icefaces.org