Çó¶Îjsp½Å±¾ÓÃajaxÌøµ½actionÖÐ ²éѯÍêÒÔºó ÔÚ´Óaction·µ»ØajaxÏêϸ´úÂë ¾ÍÊÇÒªÇóÒ³Ã治ˢÐÂ
Ò³Ã涨ÒåÒ»¸ödiv£¬¼ÙÉèidΪtest¡£»Øµ÷º¯ÊýÀïÃæÖ±½Ó document.getElementById('test').innerHTML=responsetext;
struts2µÄºóÃæµÄ£º
package com.vmkid.iplug.busserver.action;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import com.opensymphony.xwork2.ActionSupport;
import com.vmkid.iplug.busserver.common.OptionBean;
import com.vmkid.iplug.busserver.dao.OptionBeanDAO;
public class AjaxGetTypeAction extends ActionSupport implements
ServletRequestAware, ServletResponseAware {
private static final long serialVersionUID = -7935648568639117966L;
private HttpServletRequest request;
private HttpServletResponse response;
public void setServletRequest(HttpServletRequest request) {
this.request = request;
}
public void setServletResponse(HttpServletResponse response) {
this.response = response;
}
public String execute() {
String pTypeId = request.getParameter("pTypeId");
ArrayList<OptionBean> lst;
try {
lst = OptionBeanDAO.getTypeLst(pTypeId);
ÇëÎÒÓÃFCKÉÏ´«Îļþ,ÔÚ±¾µØµÄwindows»úÉϲâÊÔ¿ÉÒÔ£¬µ«²¿Êðµ½linux·þÎñÆ÷ÉϾÍÉÏ´«²»ÁËÎļþ£¬ÉÏ´«Îļþʱһֱ¿¨ÔÚÄÇÀï¡£Íû¸÷λ´óϺָµã£¬Ð»Ð»£¡
·¹ý£¬°ïÄ㶥һÏ¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
ÉÏ´«ÎļþµÄ·¾¶ÎÊÌ⣬ ......