📄 checkoutaction.java
字号:
package netstore.order;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import netstore.framework.exceptions.BaseException;
import netstore.framework.SessionContainer;
import netstore.framework.util.IConstants;
import netstore.framework.ShoppingCartItem;
import netstore.framework.ShoppingCart;
import netstore.framework.NetstoreBaseAction;
import netstore.service.INetstoreService;
import netstore.businessobjects.*;
import java.util.List;
import java.util.Iterator;
/**
* An action that signs the user off of the system.
*
*/
public class CheckoutAction extends NetstoreBaseAction {
public ActionForward execute( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws Exception {
// Check to make sure the user is logged in
//检测用户是否已登录
if(!isLoggedIn(request)) {
// Remember the path of where the user was going so they can be
// taken straight there after login is successful
//记录,成功后会跳到哪里,目前程序中并未使用该变量
String path = mapping.findForward(IConstants.SUCCESS_KEY).getPath();
//setLoginToken(request.getSession(), path);
// Forward the user to the signon page
//全局转向,跳转到登录页面
return mapping.findForward(IConstants.SIGNON_KEY);
}
return mapping.findForward( IConstants.SUCCESS_KEY );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -