📄 customeraction.java
字号:
/*
* 作者:武律
* 时间:2007年11月28日
* 功能:处理用户信息
*/
package com.mole.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.mole.struts.bean.CustomerInfoBean;
import com.mole.struts.dao.CustomerInfoDAO;
/**
* MyEclipse Struts Creation date: 11-28-2007
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class CustomerAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String vid = request.getParameter("vid");
CustomerInfoBean bean = new CustomerInfoBean();
if (vid == null) {
bean.setID(request.getSession().getAttribute("user").toString());
bean.setName(request.getSession().getAttribute("name").toString());
bean.setNickname(request.getSession().getAttribute("nickname")
.toString());
bean.setBlogTitle(request.getSession().getAttribute("title")
.toString());
bean.setBlogSubTitle(request.getSession().getAttribute("subtitle")
.toString());
bean.setBlogStyle(request.getSession().getAttribute("style")
.toString());
request.setAttribute("Customer", bean);
return mapping.findForward("goCustomer");
} else {
CustomerInfoDAO dao = new CustomerInfoDAO();
try {
bean = dao.getCustomerInfo(vid);
} catch (Exception e) {
e.printStackTrace();
}
request.setAttribute("Customer", bean);
return mapping.findForward("goCustomer");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -