?? editaccountpageaction.java
字號:
package com.netshop.web.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.netshop.domain.model.*;
import com.netshop.domain.service.*;
import com.netshop.domain.service.impl.*;
import com.netshop.web.struts.form.UserInfoForm;
import org.springframework.beans.support.PagedListHolder;
public class EditAccountPageAction extends IDValidateAction {
/*
* (non-Javadoc)
*
* @see org.digitstore.web.struts.action.SecureBaseAction#doExecute(org.apache.struts.action.ActionMapping,
* org.apache.struts.action.ActionForm,
* javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
protected ActionForward doExecute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
UserInfoForm acctForm = (UserInfoForm) form;
if (UserInfoForm.VALIDATE_EDIT_ACCOUNT.equals(acctForm
.getValidate())) {
UserinfoManager accManager = ManagerFactory.createAccountManager();
ProductManager proManager = ManagerFactory.createProductManager();
/* acctForm.getAccount().setListOption(
request.getParameter("account.listOption") != null);
acctForm.getAccount().setBannerOption(
request.getParameter("account.bannerOption") != null);
*/ UserInfo account = acctForm.getAccount();
//System.out.println("1"+account.getFirstName());
accManager.updateAccount(account);
acctForm.setAccount(accManager.getAccount(account.getUsername()));
//System.out.println("2"+acctForm.getAccount().getFirstName());
//System.out.println(new
// String(acctForm.getAccount().getFirstName().getBytes("iso-8859-1"),"UTF-8"));
/*PagedListHolder myList = new PagedListHolder(proManager
.getProductListByCategory(account.getFavouriteCategoryId()));
myList.setPageSize(4);
acctForm.setMyList(myList);*/
request.getSession().setAttribute("accountForm", acctForm);
request.getSession().removeAttribute("workingAccountForm");
return mapping.findForward("success");
} else {
request
.setAttribute(
"message",
"Your account was not updated because the submitted information was not validated.");
return mapping.findForward("failure");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -