featuredpageaction.java
来自「一个netstore的完整代码,他使用了j2ee和webservice技术,并使」· Java 代码 · 共 30 行
JAVA
30 行
package netstore.catalog;
import java.util.List;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import netstore.framework.exceptions.BaseException;
import netstore.framework.SessionContainer;
import netstore.framework.NetstoreBaseAction;
import netstore.catalog.view.ItemDetailView;
import netstore.framework.util.IConstants;
import netstore.service.INetstoreService;
public class FeaturedPageAction extends NetstoreBaseAction {
public ActionForward execute( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws Exception {
// Call the netstore service and ask it for an ItemView for the item
INetstoreService serviceImpl = getNetstoreService();
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 + -
显示快捷键?