/* Code by George Kichukov for SAS 11/26/2002 * This class is used to modify not available list for Minors */ package admin; import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; import utilities.*; public class ModifyMajorList extends HttpServlet { private String errorTarget = "../admin/index.jsp"; public void init(ServletConfig config) throws ServletException { super.init(config); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // If it is a get request forward to doPost() doPost(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //name of the user String name=""; PrintWriter out = response.getWriter(); response.setContentType("text/html"); //first thing that every servlet or jsp should do is check if user is logged in HttpSession session = request.getSession(false); //if not logged in redirect to login if(session == null) { HTMLUtils.printRedirectPage(out, "You must login to the system prior to viewing this page.", errorTarget); return; } //else if logged in take the name from the session else { name=(String)session.getAttribute("user"); //if the name is null if(name == null) { HTMLUtils.printRedirectPage(out, "You must login to the system prior to viewing this page.", errorTarget); return; } } //second output the Admin Header HTMLUtils.printAdminHeader(out); //display welcome message to the user out.println("
Welcome " + name + "
"); //get the parameters String id = request.getParameter("id"); //if this is for specific major or minor String mID = request.getParameter("mID"); String oper = request.getParameter("oper"); String table = request.getParameter("table"); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); //set up the form out.println(""); out.println(""); HTMLUtils.printAdminFooter(out); } }