惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - 笑笑江南

sss IBATIS 延迟加载 iBATIS一对多/多对多N+1问题解决方案 - 笑笑江南 - 博客园 [转]office outlook 2007 如何设置开机自动启动 代码整洁之道 类关系 eclipse 快捷键 9-15 企业数据更新 mysql 常用函数 利用myeclipse生成Hibernate Mapping文件【转】 配置eclipse下tomcat启动参数【转】 安装svneclipse .net 开发相关工具(包)的作用 basicform 与 store gridpanel中拖拽排序 struts2 file 标签产生的一个问题 applyTo ,render, contentel,el,applytomarkup 的区别 呕吐呕吐 tabpanel 添加 tab
使用 ajax 提交数据
笑笑江南 · 2008-11-30 · via 博客园 - 笑笑江南

var Ajax = {

    xmlHttp:

"",
    getYear:
function(){
      
return  document.getElementById("SY").selectedIndex+1900+"";
    },
    getMonth: 
function (){
      
return  document.getElementById("SM").selectedIndex+1+"";
    },
 createXMLHttpRequest:
function () {
      
if (window.ActiveXObject) {
          xmlHttp 
= new ActiveXObject("Microsoft.XMLHTTP");
      }
      
else if (window.XMLHttpRequest) {
          xmlHttp 
= new XMLHttpRequest();
      }
 },
 send:
function () {
   
this.createXMLHttpRequest();
   xmlHttp.onreadystatechange 
= this.showResponse;
   xmlHttp.open(
"POST""DateSetAjax.action?toShowYearMonth="+ leftPad(this.getYear ())+"-"+leftPad(this.getMonth()), false);
   xmlHttp.send(
"yearmonth=aa");
 },
 showResponse:
function(){
    
if(xmlHttp.readyState == 4) {
      
if(xmlHttp.status == 200) {  
       
var data =  xmlHttp.responseText;
       
if(data=="null")
         data 
= "";
       CLD.date1.value
=data;
    }
   }
 }

}

Ajax.send(); 发送请求。

 上面代码 参数必须在附在url 后面 才能在struts2中取到。xmlHttp.send("yearmonth=aa"); 中的参数并不起作用。

send 怎么发送数据呢

ServletActionContext.getRequest().getParameter(key); ok

ActionContext.getContext().get("request").get(key);  null.