www.pudn.com > restrant.zip > UserServlet.java, change:2014-03-04,size:728b


package com.alex.restrantol.servlet; 
 
import java.io.IOException; 
import java.util.List; 
 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
 
import com.alex.restrantol.dao.UserDao; 
 
public class UserServlet extends HttpServlet { 
	protected void service(HttpServletRequest req, HttpServletResponse res) 
			throws ServletException, IOException { 
				String type = req.getParameter("type"); 
				if("findusers".equals(type)){ 
					List list =new UserDao().findUserAll(); 
					req.setAttribute("userlist", list); 
					req.getRequestDispatcher("allUsers.jsp").forward(req, res); 
				} 
	} 
}