www.pudn.com > restrant.zip > myCenter.java, change:2014-01-25,size:1000b


package com.alex.restrantol.servlet; 
 
import java.io.IOException; 
 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
 
import com.alex.restrantol.entity.UserEntity; 
 
public class myCenter extends HttpServlet { 
 
	public void doGet(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException { 
			this.doPost(request, response); 
	} 
 
	public void doPost(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException { 
			String type = request.getParameter("type"); 
			if("goTo".equals(type)){ 
				UserEntity user = (UserEntity) request.getSession().getAttribute("user"); 
				if(user != null){ 
					request.getRequestDispatcher("myCenter.jsp").forward(request, response);			 
				}else{ 
					request.getRequestDispatcher("login.jsp").forward(request, response); 
				} 
			} 
	} 
 
}