1 package org.springframework.samples.jpetstore.web.struts; 2 3 import javax.servlet.http.HttpServletRequest ; 4 import javax.servlet.http.HttpServletResponse ; 5 6 import org.apache.struts.action.ActionForm; 7 import org.apache.struts.action.ActionForward; 8 import org.apache.struts.action.ActionMapping; 9 10 public class ListOrdersAction extends SecureBaseAction { 11 12 protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { 13 AccountActionForm acctForm = (AccountActionForm) form; 14 String username = acctForm.getAccount().getUsername(); 15 request.setAttribute("orderList", getPetStore().getOrdersByUsername(username)); 16 return mapping.findForward("success"); 17 } 18 19 } 20 | Popular Tags |