I am writing a java web application using Servlets. It contains two buttons and each one imports some data from some csv files. When a button is pressed the csv files are loaded in again.
Is there any way to load the csv files when the page is iniated? So I will Objectify the csv files to use them later instead of loading them all the time.
Each button is a servlet and it contains this code:
protected void doGet(HttpServletRequest req,HttpServletResponse resp)
throws ServletException, IOException
{
String code=req.getParameter("code");
String name= req.getParameter("name");
CSVReader reader=new CSVReader();
ArrayList<Person> people=reader.readPeople(); // reading from csv files
reader.readParents();
reader.readKids();