Excellent idea! But could you tell me how the servlet fits into my JSF project. I have a jsp page that allows the user to select the file. The selected file is an xls file and is pulled from the database. I want to show the file as a xls document in a browser(or swing). So if I use your example, how would I factor it in? Not sure how to define the navigation rules.
Thanks On Mon, Oct 26, 2009 at 8:50 AM, David Fisher <[email protected]>wrote: > In Apache Tomcat we have a servlet that does something like this: > > public class MyExcelServlet extends HttpServlet { > public void doGet (HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException { > try { > response.setContentType("application/vnd.ms-excel" ); > response.setHeader("Content-disposition", > "inline;filename="+filename); > HSSFWorkbook wb = new HSSFWorkbook(); > // create your workbook using Apache POI > wb.write(response.getOutputStream()); > } catch (Exception e) { > > } > } > } > > On Oct 26, 2009, at 6:34 AM, @lan Williamson wrote: > > That is the bit you are going to have to code up yourself >> >> The purpose of POI is to give you the low-level functions to which to >> operate with an EXCEL file. >> >> >> >> veena pandit wrote: >> >>> Hi, >>> >>> It looks like all the examples on the page here: >>> >>> http://poi.apache.org/spreadsheet/examples.html >>> >>> are examples that produce an excel file. I need an example >>> that opens the file as a swing application.or in the browser, >>> Is there such an example? >>> >> >> --------------------------------------------------------------------- >> 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] > >
