David, I tried so hard to be clear. My first page is a jsp page. I figured out how to redirect to a servlet. and within eclipse it works ok. But when I deploy it as a war file it doesn't work. I need to make it work and I will also post to Sun forum.
Thanks, Veena On Tue, Oct 27, 2009 at 10:25 AM, David Fisher <[email protected]>wrote: > You need to get help from the the JSF people in setting up a servlet. > > JSPs are meant to serve text formats only, Excel XLS is a binary format. > You can get away with serving binary through a JSP in some servers, but you > cannot in all of them. For instance I got away with serving PDF through a > jsp in Tomcat in version 3.3 through version 4.1.29, but then it was no > longer possible, and it was time to deploy a servlet. > > The people at javaranch ought to be able to help you, just make sure you > tell them that it is a binary file format. > > I suggest that you take the time to carefully read everything sent to you, > all the bits are there. Please make sure of your requirements, try to make > your example simple and describe all of the requirements and tools. You'll > get better help, learn more, and won't frustrate the four people willing to > try to help you anyway. > > Regards, > Dave > > > On Oct 27, 2009, at 7:06 AM, veena pandit wrote: > > 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. >> >> 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 >> >> 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). >> >> Thanks, >> >> Veena >> >> On Tue, Oct 27, 2009 at 9:50 AM, Bruno Girin <[email protected]> >> wrote: >> >> 2009/10/27 veena pandit <[email protected]>: >>> >>>> I don't think i will have to edit and save. I need to check. >>>> I think the files are read only. But thanks to Bruno, >>>> and this list. I was able to open the file from within eclipse. >>>> >>> >>> I'm not sure I understand what you mean by opening the file from >>> within eclipse. If you mean that the code you have written in eclipse >>> can now open the xls file inside your servlet, then great, there's >>> progress. >>> >>> I can't seem to deploy it and open it in my browser yet. >>>> Any suggestions on the deployment? >>>> >>> >>> I am not sure I understand this correctly either. When you say that >>> you want to deploy and open it in your browser, what are you actually >>> attempting to do? Do you want to see the excel sheet as a web page, >>> like GoogleDocs do or do you want the browser to receive the file and >>> open it with Excel? >>> >>> I am getting a FacesContext not found >>>> error. >>>> >>> >>> Well, this means that your JSF configuration is incorrect. The problem >>> is probably somewhere in your web.xml or faces-config.xml files. >>> However, this has nothing to do with POI so this list is not the best >>> place to ask that sort of questions. You'd be better off asking help >>> for this specific problem on a JSF forum where you have people who can >>> help better. >>> >>> It would help enormously if you could describe what you are trying to >>> do. At the moment, the different bits of information I've gathered >>> from your various emails tell me that you are writing a JSF >>> application that runs in a servlet container and that needs to send >>> Excel files to the user's browser. Is this correct? What I don't >>> understand is: >>> 1. do you need to modify the Excel file inside the servlet before >>> sending it to the browser? >>> 2. how do you expect the browser to handle the file? >>> >>> Bruno >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >>> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
