?? productinfoaction.java
字號:
package com.briup.customer.web.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.briup.common.dao.pojo.Product;import com.briup.customer.service.ICustomerService;public class ProductInfoAction extends Action{ ICustomerService customerService; public void setCustomerService(ICustomerService customerService) { this.customerService = customerService; } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //從session中獲得user對象 String name = request.getParameter("name"); try { Product product = customerService.getProductInfo(name); request.setAttribute("product", product); return mapping.findForward("productinfo"); } catch (Exception e) { e.printStackTrace(); return mapping.findForward("productinfo"); } }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -