All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
使用ascx和Div来扩充列表框选择功能_[Asp.Net教程]
从.NET类库代码来看ASP.NET运行时_[Asp.Net教程]
注册COM+服务组件
ASP.Net,2.0窗体身份验证机制详解_[Asp.Net教程]
C#中goto语句的使用方法
开发技术展望,Asp.net3.0,蓝图_.net资料_编程技术
ASP.NET2.0数据操作之母板页和站点导航_[Asp.Net教程]
C#中创建窗体
PHP+CSS实现打印简单数据报表功能_[PHP教程]
ASP.NET,Atlas,Framework概览_[Asp.Net教程]
Reading number is top 10 pictures
Absolutely shocked. National geographic 50 animal photographys10
网上疯传的一篇小学作文《爸爸也治不了妈妈》
The sixties of the last century, China is such a kill pig
美女挤公交
最2B的公司制度
美女就是美女
陪睡门马睿菈自曝写真 称首拍大尺度照片2
The hot big eye big breast beauty3
男人帮杂志里的惹火性感美女1
中国文革时期的色情图片2
Download software ranking
asp.netWeb服务器高级编程
Popkart Cracked versions Mobile phone games
终极变速大师Speeder3.26
美女写真2
Such love down(擒爱记)
Ashlynn Video3
jBuilder2006
株洲本地在线棋牌游戏
网页特效实例大全
少妇苏霞全本
归海一刀 published in(发表于) 2014/3/16 2:53:18 Edit(编辑)
servlet+ajax实例:由省份选择城市_[AJAX教程]

servlet+ajax实例:由省份选择城市_[AJAX教程]

servlet+ajax实例:由省份选择城市_[AJAX教程]

一、test.html




MyHtml.html













二、servlet源程序


package com.stephen.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import org.dom4j.*;



import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
* @author stephen
*
* TODO To change the template for this generated type comment go to Window -
* Preferences - Java - Code Style - Code Templates
*/
public class SelectCityServlet extends HttpServlet {



public SelectCityServlet() {
super();
}


public void destroy() {
super.destroy();
}


public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {



response.setCharacterEncoding("UTF8");
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
String state = request.getParameter("state");



Document document = DocumentHelper.createDocument();


Element root = document.addElement("state");


Element city = null;
if("zj".equals(state)){
city = root.addElement("city");
city.setText("杭州");
city = root.addElement("city");
city.setText("huzhou");
}else{
city = root.addElement("city");
city.setText("南京");
city = root.addElement("city");
city.setText("苏州");
city = root.addElement("city");
city.setText("yangzhou");
}



PrintWriter out=response.getWriter();
String s = root.asXML();


out.write(s);
out.close();
}


}


来源:http://blog.csdn.net/javatwt







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.