package com.mingsoft.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.mingsoft.constant.SessionConst;

/**
 * @author 荣繁奎
 * @date:2013-11-22 上午11:09:23
 * @version : 系统退出
 *
 */
@SuppressWarnings("serial")
public class OutServlet extends BaseServlet {

	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doGet(request, response);
		//退出系统时删除session值
		HttpSession sesion = request.getSession();
		if(sesion!=null){
			//如果session值不为空 则执行删除session操作
			sesion.removeAttribute(SessionConst.ADMIN_SESSION.toString());
		}
		response.sendRedirect(BASE_URL+"login");
	}

	
}
