Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sheet.jsp page am trying this



<%@ page import="com.ExcelDataParser"%>


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here




out.write("" + work+"
");





i got output like this out.write("input type="radio">"+work+"br>"); am not getting sheets what display in console.in console i got like this
sheet1
sheet2
sheet3
sheet4 i want to display same output in jsp page with radio button for all sheet.i want sample code

What I have tried:

package com;

import java.io.FileInputStream;

import java.io.IOException;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class ExcelDataParser
{
	public static void main(String args[])	 throws IOException
	{




		//ArrayList<string> arr=new ArrayList<string>();

    	try {
    		 String str="C:\\Downloads\\Associate_Details.xlsx";

             FileInputStream fileInputStream = null;

			fileInputStream = new FileInputStream(str);
			 XSSFWorkbook workbook = new XSSFWorkbook(fileInputStream);
	        	String work=null;
	        	for (int i = 0; i < workbook.getNumberOfSheets(); i++)
	        	 {

	        		   work=workbook.getSheetName(i);
	        		 //  arr.add(work);




	        	System.out.println(work);

	        	 }
	        	workbook.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}



	}

	}
Posted
Updated 16-Oct-17 21:00pm
Comments
ThilinaMD 18-Oct-17 7:12am    
you are trying a jsp page output using a normal class. to get the output in jsp page use the above code in a jsp page or a servlet, or create a method with return statement and call it through your jsp/servlet page

This is the third time you have posted this question. Please do not keep reposting. If you have extra information to add then edit your original.
 
Share this answer
 
This is not how you do this.

You need to learn whole new area of development.
Please search on google about how to develop web application in JAVA
You can take a quick look at JSP Tutorial[^]

But if you want to create a static page using your some java application or function; then you probably need to create your own rule about, how you are going to transfer a xls file to an html or jsp file
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900