Bruno, Sorry I think I tried to be clear but I still confused the issue. My first jsp page allows the user to select a file. The action in the backing bean of that file selection component(which is a dropdown) redirects to a servlet which serves the page.
Thanks, Veena On Tue, Oct 27, 2009 at 10:29 AM, Bruno Girin <[email protected]> wrote: > 2009/10/27 veena pandit <[email protected]>: > > Hi, > > > > 1. That is exactly what I mean. I have a jsf dynamic web project in > > eclipse. When I right click on the first web page and select run on > Server, > > it runs correctly and locates the correct file and opens it as a xls > > document. > > OK > > > > > 2. In order to open the page in a browser, you have to deploy the > project > > as a war file to the webapps directory of tomcat, then point your browser > to > > the location of the page and this should run the application. But here > is > > where I am getting a java.lang.RuntimeException FacesContext not found > > exception. I have posted to a jsf forum at javaranch.com > > Yes, that's how you would deploy it on Tomcat. If it doesn't work then > it means that you web.xml or your faces-config.xml has a problem and > works well in the embedded container in eclipse but doesn't work in > Tomcat. > > > > > > 3. I dont need to modify the excel file. I just clarified and it is open > as > > a read only document. I am expecting the browser to open the file > viewable > > as an excel document handled by the poi(similar to when I run it from > > eclipse). > > This is where you got us all confused and where I think you > misunderstand what POI does. Opening the file in your browser has > nothing to do with POI, it's done by the browser running Excel when it > receives the file. > > From your description above, you don't need POI at all, you can just > copy the content of your file input stream to your response output > stream in your servlet and that is enough to send the file to the > browser and have the browser open it. In fact, that would be a better > solution because you would then send the file unmodified and you would > be able to stream it too. > > And as David say, that part probably needs to be done in a separate > servlet that runs beside the JSP/JSF application you have and is > dedicated to serve binary files to the browser. > > Bruno > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
