featuredpageaction.java

来自「《基于Eclipse的开源框架技术与实战》[第5章]随书源码」· Java 代码 · 共 40 行

JAVA
40
字号
package com.free.struts.storefront.catalog;import java.util.List;import javax.servlet.http.*;import org.apache.struts.action.*;import com.free.struts.storefront.catalog.view.ItemDetailView;import com.free.struts.storefront.framework.StorefrontBaseAction;import com.free.struts.storefront.framework.UserContainer;import com.free.struts.storefront.framework.exceptions.BaseException;import com.free.struts.storefront.framework.util.IConstants;import com.free.struts.storefront.service.IStorefrontService;/** * <p>Title: Eclipse Plugin Development</p> * <p>Description: Free download</p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: Free</p> * @author gan.shu.man * @version 1.0 */public class FeaturedPageAction extends StorefrontBaseAction {  public ActionForward execute( ActionMapping mapping,                                ActionForm form,                                HttpServletRequest request,                                HttpServletResponse response )   throws Exception {    // Call the storefront service and ask it for an ItemView for the item    IStorefrontService serviceImpl = getStorefrontService();    List featuredItems = serviceImpl.getFeaturedItems();    // Store the featured items into request scope    request.setAttribute( IConstants.FEATURED_ITEMS_KEY, featuredItems );    // Return the ActionForward that is defined for the success condition    return mapping.findForward( IConstants.SUCCESS_KEY );  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?