webtier@glassfish.java.net

Re: creating a file from managed bean.

From: <webtier_at_javadesktop.org>
Date: Tue, 17 Aug 2010 10:01:22 PDT

hello Manuel, thank you for your answer. The problem is solved now. but I made a modification since the original code you gave me did not work. your code throws the following exception:
java.lang.ClassCastException: com.sun.faces.context.ExternalContextImpl cannot be cast to javax.servlet.ServletContext

so I used the folowing line to get the real path of my root:

String path = FacesContext.getCurrentInstance().getExternalContext().getRealPath("/");
[Message sent by forum member 'samanosuke31']

http://forums.java.net/jive/thread.jspa?messageID=480415