protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
		ComputerServiceImpl computerService = new ComputerServiceImpl();
		
		int page = 1;
		int recordsPerPage = 10;
		int endPageRecord;
		List<Computer> list = null;
		int startPageRecord;
		String filter= request.getParameter("filter");	
		if (request.getParameter("page") != null)
			page = Integer.parseInt(request.getParameter("page"));
		
		if (filter !=null){
			try {
				list = computerService.displayFilteredComputers((page - 1) * recordsPerPage, recordsPerPage, filter);
			} catch (InstantiationException | IllegalAccessException
					| ClassNotFoundException | SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		else{		
			try {
				list = computerService.displayComputers(
						(page - 1) * recordsPerPage, recordsPerPage);
			} catch (InstantiationException | IllegalAccessException
					| ClassNotFoundException | SQLException e) {
				e.printStackTrace();
			}
		}
	
		int noOfRecords = 0;
		try {
			noOfRecords = computerService.getNoOfRecords();
		} catch (InstantiationException | IllegalAccessException
				| ClassNotFoundException | SQLException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}



		
		// int noOfPages = (int) Math.ceil(noOfRecords * 1.0 / recordsPerPage);
		startPageRecord = (page - 1) * recordsPerPage + 1;
		if ((noOfRecords - startPageRecord) >= recordsPerPage) {
			endPageRecord = page * recordsPerPage;
		} else {
			endPageRecord = noOfRecords;
		}

		request.setAttribute("computerList", list);
		request.setAttribute("currentPage", page);
		request.setAttribute("recordsPerPage", recordsPerPage);
		request.setAttribute("noOfRecords", noOfRecords);
		request.setAttribute("startPageRecord", startPageRecord);
		request.setAttribute("endPageRecord", endPageRecord);
		request.setAttribute("filter", filter);

		System.out.println(page);
		System.out.println(noOfRecords);
		getServletContext().getRequestDispatcher("/welcome.jsp").forward(
				request, response);
	}