import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SearchLogic extends HttpServlet { private PrintWriter out = null; int n =0; public void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); out = response.getWriter(); HttpSession session = request.getSession(); sessionInfo info = (sessionInfo)session.getAttribute("Attribute"); //session.setAttribute("Attribute", info); if (info == null){ info = new sessionInfo(); } String[] month = request.getParameterValues("Month"); if (month != null){ info.setMonth(month[0]);} String tempday = request.getParameter("d"); if (tempday != null){ int tempd = Integer.parseInt(tempday); info.setDay(tempd);} String Year = request.getParameter("Year"); if (Year != null){ int Y = Integer.parseInt(Year); info.setYear(Y);} out.println(" "); out.println(""); out.println(""); out.println("New Page 1"); out.println(""); out.println(""); out.println("SErachLogic userID" + info.getUserID()); /////This is if statement is comemnted out for now. /*if (info.getUserID() == -1){ String login = "login"; RequestDispatcher dispatcher0 = request.getRequestDispatcher(login); dispatcher0.include(request, response); String calendar = "perpetualCalendarS"; RequestDispatcher dispatcher1 = request.getRequestDispatcher(calendar); dispatcher1.include(request, response); out.println(""); out.println(""); } else{*/ //Here is where Search Logic calls the other Classes //Include Browser String browser = "Browser"; RequestDispatcher dispatcher0 = request.getRequestDispatcher(browser); dispatcher0.include(request, response); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println("
"); // Include the month Calendar String calendar = "perpetualCalendarS"; RequestDispatcher dispatcher1 = request.getRequestDispatcher(calendar); dispatcher1.include(request, response); out.println(""); //Include Day Calendar String day = "dayCalendar"; RequestDispatcher dispatcher2 = request.getRequestDispatcher(day); dispatcher2.include(request, response); out.println("
"); //} out.println(""); out.println(""); out.println("search logic " + n); n++; out.flush(); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } }