@@ -0,0 +1,1789 @@
+package com.ust;%0A%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0A%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/**%0A * Servlet implementation class AdminSearch%0A */%0Apublic class AdminSearch extends HttpServlet %7B%0A%09private static final long serialVersionUID = 1L;%0A       %0A    /**%0A     * @see HttpServlet#HttpServlet()%0A     */%0A    public AdminSearch() %7B%0A        super();%0A        // TODO Auto-generated constructor stub%0A    %7D%0A%0A%09/**%0A%09 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)%0A%09 */%0A%09protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException %7B%0A%09%09//Retrieve values from html page%0A%09%09  String search=request.getParameter(%22pp%22);%0A%0A%09%09   PrintWriter pw=response.getWriter();%0A%09%09  //I will call the checkUswer method of CredentialChecker class%0A%09%09  CredentialChecker cc= new CredentialChecker();%0A%09%09  %0A%09%09  boolean flag =cc.searchProduct(search);%0A%0A%09%09    if(flag==true)%7B%0A%09%09    //RequestDispatcher rd =request.getRequestDispatcher(%22searchView.jsp%22);%0A%09%09    //rd.forward(request, response);%0A%0A%0A%09%09    %09String productName=cc.productName;%0A%09%09    %09int productId=cc.productId;%0A%09%09    %09double productPrice=cc.productPrice;%0A%0A%0A%09%09    %09request.setAttribute(%22productId%22, productId);%0A%09%09    %09request.setAttribute(%22productName%22, productName);%0A%09%09    %09request.setAttribute(%22productPrice%22, productPrice);%0A%09%09    %09request.getRequestDispatcher(%22AdminSearchForm.jsp%22).forward(request, response);%0A%0A%0A%09%09   %7D%0A%09%09   else%7B%0A%09%09    //RequestDispatcher rd =request.getRequestDispatcher(%22Failure.jsp%22);%0A%09%09     //rd.forward(request, response);%0A%09%09    pw.println(%22no matching product has been found%22);%0A%09%09   %7D%0A%0A%0A%09%7D%0A%0A%7D%0A

Create AdminSearch.java