I have been flailing widely about trying to get the information from the arrayList to the jsp page to print to a table on the jsp page.
The information on the txt file is
Name:Department :Job Title:Year Hired:Gender
Any insights woudl be greatly appreciated!
Thanks,
JoeMac
The information on the txt file is
Name:Department :Job Title:Year Hired:Gender
Code:
<%@page import="java.io.*"%>
<%@ page session="false"%>
<html>
<head><title>Employees Hired</title></head>
<head><description>Employee Listing</description></head>
<form method="post" action="hiredEmployee.jsp"/>
<table border='2' cellspacing='0' cellpadding='4'>
<tr><th> Name </th><th> Department <th> Job Title </th><th> Year Hired </th><th> Gender </th></tr>
</html>
////////////////////////////////////////////////////////////////////////////////////////
package domain;
import java.util.Scanner;
import java.io.*;
import java.util.ArrayList;
import java.lang.*;
public class HiredEmployee {
public ArrayList line = new ArrayList();
private String temp="";
private String[] words;
private Scanner sInput = null;
public ArrayList<String> getLine(){
words=new String[line.size()];
try{
sInput = new Scanner(new FileReader("hired.txt"));
while (sInput.hasNextLine()){
temp=sInput.nextLine();
line.add(temp);
//words = temp.split(":");
}
}
catch (FileNotFoundException exception) {}
sInput.close();
return line;
}
}
Thanks,
JoeMac
Comment