日期:2014-05-16 浏览次数:20927 次
var xmlHttp;
function doti(x){
getXmlHttpRequestObject();
var url="showValue_selectValue.action?key="+x;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=callback;
xmlHttp.send(null);
}
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
xmlHttp= new XMLHttpRequest();
} else {
if (window.ActiveXObject) {
xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert("您的浏览器不支持");
}
}
}
function callback(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
createTextValue();
}
}
}
function createTextValue(){
var str=xmlHttp.responseText;
alert(str);
}
package com.action;
import java.util.List;
import com.dao.DaoImpl;
import com.opensymphony.xwork2.ActionSupport;
public class ShowValueAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
private String key;
private String list;
private DaoImpl di;
public String getList() {
return list;
}
public void setList(String list) {
this.list = list;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String selectValue(){
di=new DaoImpl();
list=di.selectValue(key);
return SUCCESS;
}
}