www.pudn.com > dangdang.zip > ShowMainProductsAction.java, change:2006-06-22,size:997b


package com.tarena.dangdang.web; 
 
import java.util.List; 
import java.util.Map; 
 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
 
import org.smartstruts.action.Action; 
import org.smartstruts.action.ActionForm; 
 
import com.tarena.dangdang.biz.ProductBiz; 
import com.tarena.dangdang.entity.Product; 
import com.tarena.dangdang.util.BeanFactory; 
 
public class ShowMainProductsAction extends Action{ 
    private ProductBiz productBiz = (ProductBiz)BeanFactory.getBean("productBiz"); 
	@Override 
	public String execute(ActionForm form, HttpServletRequest request, 
			HttpServletResponse response) throws Exception { 
		 
		Map<String,List<Product>> result = productBiz.queryMainProducts(); 
	      
		request.setAttribute("hotProducts",result.get("hotProducts")); 
		request.setAttribute("newProducts",result.get("newProducts")); 
		request.setAttribute("recommandProducts",result.get("recommandProducts")); 
		 
		return "ok"; 
	} 
    
}