www.pudn.com > Jsp-Blog.rar > BlogUsersServlet.java, change:2010-05-26,size:919b


package myblog.servlet; 
 
import java.io.IOException; 
import java.util.ArrayList; 
 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
 
import myblog.dao.BlogUsersDao; 
import myblog.entity.Users; 
 
public class BlogUsersServlet extends HttpServlet { 
	public void doPost(HttpServletRequest request, HttpServletResponse response) { 
		BlogUsersDao user = new BlogUsersDao(); 
		ArrayList<Users> list = user.blogUsers(); 
		request.setAttribute("userlist", list); 
		try { 
			request.getRequestDispatcher("users.jsp").forward(request, response); 
		} catch (ServletException e) { 
			e.printStackTrace(); 
		} catch (IOException e) { 
			e.printStackTrace(); 
		} 
 
	} 
 
	public void doGet(HttpServletRequest request, HttpServletResponse response) { 
		doPost(request, response); 
	} 
}