| 1 package xpetstore.web.struts.action.customer; 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 import xpetstore.domain.customer.ejb.Customer; 11 12 import xpetstore.web.struts.action.BaseAction; 13 14 15 28 public class MyAccountAction 29 extends BaseAction 30 { 31 33 36 protected ActionForward doExecute( ActionMapping mapping, 37 ActionForm form, 38 HttpServletRequest request, 39 HttpServletResponse response ) 40 throws Exception  41 { 42 CustomerForm frm = ( CustomerForm ) form; 43 String userId = ( String ) request.getSession( ).getAttribute( USERID_KEY ); 44 45 Customer cst = getPetstore( ).getCustomer( userId ); 46 frm.setCustomer( cst ); 47 48 return mapping.findForward( SUCCESS ); 49 } 50 } 51 | Popular Tags |