www.pudn.com > bookshop.zip > OrderServlet.java, change:2013-07-09,size:1013b


package com.tarena.web; 
 
import java.io.IOException; 
import java.io.PrintWriter; 
import java.util.ArrayList; 
 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
import javax.servlet.http.HttpSession; 
 
import com.tarena.bean.BookItem; 
import com.tarena.bean.Cart; 
 
public class OrderServlet extends HttpServlet { 
 
	public void service(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException { 
 
		 request.setCharacterEncoding("utf-8"); 
         response.setContentType("text/html;charset=utf-8"); 
 
 
              HttpSession session = request.getSession(); 
              Cart cart =(Cart)session.getAttribute("cart"); 
         	  ArrayList<BookItem> items = cart.getItems(); 
         	  request.setAttribute("items",items); 
 
              request.getRequestDispatcher("order_info.jsp").forward(request,response); 
	} 
 
}