example.web
Class CartAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended byorg.apache.struts.actions.DispatchAction
          extended byexample.web.CartAction

public class CartAction
extends org.apache.struts.actions.DispatchAction


Field Summary
 
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, log, messages, methods, types
 
Fields inherited from class org.apache.struts.action.Action
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY
 
Constructor Summary
CartAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward add(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Add an item to the cart based on the information in the form.
 org.apache.struts.action.ActionForward confirmOrder(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Validate and process the checkout view, set up for the confirm view.
 org.apache.struts.action.ActionForward processOrder(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process the previous view, set up for the confirmation screen.
 org.apache.struts.action.ActionForward remove(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Action to remove an item from the invoice, takes a URL parameter of 'item' with the SKU item id
 org.apache.struts.action.ActionForward setPaymentMethod(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Display form to collect payment method and billing info (if applicable)
 org.apache.struts.action.ActionForward setShipping(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Set up for the checkout process Display form to collect shipping info.
 org.apache.struts.action.ActionForward setShippingMethod(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          collect shipping Method info from UPS, based on what's in the cart.
 
Methods inherited from class org.apache.struts.actions.DispatchAction
dispatchMethod, execute, getMethod, unspecified
 
Methods inherited from class org.apache.struts.action.Action
execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CartAction

public CartAction()
Method Detail

add

public org.apache.struts.action.ActionForward add(org.apache.struts.action.ActionMapping mapping,
                                                  org.apache.struts.action.ActionForm form,
                                                  javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response)
                                           throws java.lang.Exception
Add an item to the cart based on the information in the form.

Throws:
java.lang.Exception

remove

public org.apache.struts.action.ActionForward remove(org.apache.struts.action.ActionMapping mapping,
                                                     org.apache.struts.action.ActionForm form,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws java.lang.Exception
Action to remove an item from the invoice, takes a URL parameter of 'item' with the SKU item id

Throws:
java.lang.Exception

setShipping

public org.apache.struts.action.ActionForward setShipping(org.apache.struts.action.ActionMapping mapping,
                                                          org.apache.struts.action.ActionForm form,
                                                          javax.servlet.http.HttpServletRequest request,
                                                          javax.servlet.http.HttpServletResponse response)
                                                   throws java.lang.Exception
Set up for the checkout process Display form to collect shipping info. BRAIN DAMAGE: may want to reset the form here.

Throws:
java.lang.Exception

setShippingMethod

public org.apache.struts.action.ActionForward setShippingMethod(org.apache.struts.action.ActionMapping mapping,
                                                                org.apache.struts.action.ActionForm form,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response)
                                                         throws java.lang.Exception
collect shipping Method info from UPS, based on what's in the cart. Display form to let user choose which method

Throws:
java.lang.Exception

setPaymentMethod

public org.apache.struts.action.ActionForward setPaymentMethod(org.apache.struts.action.ActionMapping mapping,
                                                               org.apache.struts.action.ActionForm form,
                                                               javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response)
                                                        throws java.lang.Exception
Display form to collect payment method and billing info (if applicable)

Throws:
java.lang.Exception

confirmOrder

public org.apache.struts.action.ActionForward confirmOrder(org.apache.struts.action.ActionMapping mapping,
                                                           org.apache.struts.action.ActionForm form,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response)
                                                    throws java.lang.Exception
Validate and process the checkout view, set up for the confirm view. We just go to the order review screen for final confirmation. BRAIN DAMAGE: This action needs to calculate tax and shipping amounts before going to the confirmation screen, something it is not currently doing properly.

Throws:
java.lang.Exception

processOrder

public org.apache.struts.action.ActionForward processOrder(org.apache.struts.action.ActionMapping mapping,
                                                           org.apache.struts.action.ActionForm form,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response)
                                                    throws java.lang.Exception
Process the previous view, set up for the confirmation screen. This places the order.

Throws:
java.lang.Exception


Copyright © -2004 . All Rights Reserved.