?? busiopportselectaction.java
字號(hào):
package com.yuanchung.sales.struts;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.ajaxtags.helpers.AjaxXmlBuilder;
import org.ajaxtags.servlets.BaseAjaxAction;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import com.yuanchung.sales.util.Constants;
public class BusiOpportSelectAction extends BaseAjaxAction {
public String getXmlContent(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
String fieldRequest = request.getParameter("field");
int field = Integer.parseInt(fieldRequest);
System.out.println("一到四的情況:"+field);
List<String> cityList = new ArrayList<String>();
cityList.add(Constants.NONE);
switch(field) {
//對(duì)于1-4的情況
case 1:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 2:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 3:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 4:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 5:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWEROREQ);
cityList.add(Constants.GREATEROREQ);
break;
case 6:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 7:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWEROREQ);
cityList.add(Constants.GREATEROREQ);
break;
case 8:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWEROREQ);
cityList.add(Constants.GREATEROREQ);
break;
case 9:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 10:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.STARTCHAR);
cityList.add(Constants.INCLUDE);
cityList.add(Constants.EXCLUDE);
break;
case 11:
cityList.add(Constants.EQEAL);
cityList.add(Constants.NOEQEAL);
cityList.add(Constants.LOWER);
cityList.add(Constants.GREATER);
cityList.add(Constants.LOWEROREQ);
cityList.add(Constants.GREATEROREQ);
break;
}
//該類用于輔助生成XML響應(yīng)
AjaxXmlBuilder builder = new AjaxXmlBuilder();
for (String city : cityList ) {
builder = builder.addItem(city, city);
}
System.out.println(builder);
return builder.toString();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -