The information on the txt file is
Name:Department:Job Title:Year Hired:Gender
Expand|Select|Wrap|Line Numbers
- <%@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