User:Da2811/sandbox

Fast Quote and Quote Management   Retrieve CustomerID * Fields are mandatory 

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  Insert title here JSP <%@ page import="java.util.*"%> <%@ page import="fastquote.app.model.*"%> <%	boolean result = (Boolean) request.getAttribute("result"); ArrayList oplist = (ArrayList) request .getAttribute("output"); ArrayList customerIDList = new ArrayList; if (result) { if (oplist.size > 0) { for (Customer info : oplist) {

customerIDList.add(info.getCustomerid); }		}

else { %> Sorry!!! There is no customer record in database <%	}	} else { %> Customer is not registered!!!! <%@ include file="RetrieveCustomerID.html"%> <%	} %>

package fastquote.app.ctrl; import fastquote.app.model.*; import java.io.IOException; import java.util.ArrayList;

import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;

import fastquote.app.model.AccidentHistory; import fastquote.app.model.AutoInsuranceCompany;

public class RetrieveCustomerIDController extends HttpServlet { private static final long serialVersionUID = 1L; public RetrieveCustomerIDController { super; }

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { }

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String cid=request.getParameter("uid"); System.out.println(cid); AutoInsuranceCompany company = new AutoInsuranceCompany; boolean result = company.checkID(Integer.parseInt(cid)); System.out.println(result); if(result) {			ArrayList listofCustomerDetails=company.retrieveCustomerList; request.setAttribute("output", listofCustomerDetails); }		request.setAttribute("result",result); RequestDispatcher rd=request.getRequestDispatcher("RetrieveCustomerID.jsp"); rd.forward(request,response); }

}