⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getcustomeraction.java

📁 struts的一些用的书籍
💻 JAVA
字号:
package app10b.action;

import app10b.to.AddressTO;
import app10b.to.CustomerTO;
import java.util.ArrayList;
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;


public class GetCustomerAction extends Action {

  public ActionForward execute(ActionMapping mapping, ActionForm form, 
    HttpServletRequest request, HttpServletResponse response) throws Exception {

    AddressTO address1 = new AddressTO();
    address1.setStreetAddress("315 Avoca Street");
    address1.setCity("Albany");
    address1.setState("NY");
    address1.setZipCode("12110");
    ArrayList phones = new ArrayList(2);
    phones.add("432 89894949");
    phones.add("432 84839283");
    address1.setPhones(phones);
    CustomerTO customer = new CustomerTO();
    customer.setContactPerson("Phillip Fry");
    customer.setAddress(address1);    
	request.setAttribute("customer", customer);
    return mapping.findForward("success");
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -