|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to do for multi access for open excle file in browser?
I would like to know how to open multi file of excel on web. Now I can create a file and open it on web already but I can open it only one excel page. when I try to open it more than one, the content of excel file will be move to the new page.
** I have tried to test it, if I have two form to post data to two servlet for each form, I can open two excel file in browser. but I have only one servlet, and I want to open it more than one page. it's not work with one servlet. I don't know how to do. Please help me if you know how to do !!!! I have used tag form to post data to xml file then it go to servlet. >> <Form name="form" action="srv-xlsdata" method="POST" target="_blank"> >> servlet File public abstract class AbstractExcelView extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { HSSFWorkbook workbook = null; long start = System.currentTimeMillis(); File newFile = null; if (getTemplatePath(request) != null) { String path = getServletContext().getRealPath(getTemplatePath(re quest)); POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(path)); workbook = new HSSFWorkbook(fs); } else { workbook = new HSSFWorkbook(); } buildWorkbook(request, workbook); String filename = getOutputFilename(request); if (filename.toLowerCase().endsWith(".xls")) { filename = filename.substring(0, filename.length() - 4); } OutputStream ostream = response.getOutputStream(); response.setContentType("application/vnd.ms-excel"); workbook.write(ostream); ostream.close(); } catch (Exception e) { throw new ServletException("Unable to build Excel Document", e); } } |
|
#2
|
|||
|
|||
|
Yeah...
Now I know how do I do...
I have to create new pattern for each servlet name. It's work!!!! So now I can open excel in browser more than 1 page. |
|
#3
|
|||
|
|||
|
What patterns did you use ???
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > How to do for multi access for open excle file in browser? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|