Ext 2.0.1 Grid 增删改 & DWR 1 实例 - 操作数据库版本
友情提示 : 下载微软网盘文件时关闭下载工具 , 否则你将得到错误的文件 , 双击 EXE 会出来 DOS 窗口 . 正确操作是点击文件名后能看到显示下载链接和文件大小等信息 .
微软的网盘终于又能用了,5G空间呢,微软就是有钱啊.
http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/AJAX/extdwrgrid.zip 1.13 MB 导入MyEclipse即可,也可用其它开发工具.
运行截图:
这次是真的了, 和数据库同步操作,不过,有安全性问题,建议加密码,一共有20个字段.后台数据库:
image
导出为Excel:
(略)
image
Ext + DWR + Mysql 简单例子
包括5个例子:
EXT 2 和 DWR 1 表格编辑控件示例(无数据库版本)
EXT 2 表格编辑控件示例(静态页面,Java和DWR无关版本)
Netbeans 6 开放文档团队在线通讯录(Ext + DWR + MySQL)
DWR 检查注册用户名是否存在
模拟DWR 引擎通过反射调用类中方法并获取返回值
要运行此例子,请先
1. 运行 table.sql 在 Mysql 中建表;
2. 修改 src/dao/UserManagerNB.java 的
public static Connection getConnection() 方法, 来连接到
正确的数据库地址.
3. 发布项目并键入地址 http://localhost:8080/extdwrgrid/ 访问;
4. 要修改例子, 注意绝大多数页面都是 UTF-8 编码的, 例如 .js 文件.
附件:
DWR通过AJAX后台POST调用参数,然后使用反射技术调用类的方法并获得结果.
后台发送的AJAX请求:
POST dwr/exec/JUserManager.checkUserExits.dwr HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://192.168.1.200:8000/ajaxreview/ajax_reg_dwr.html
Content-Type: text/plain
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: 192.168.1.200:8000
Content-Length: 146
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=F0D84EF983957A66162555D3AB966A29
callCount=1
c0-scriptName=JUserManager // 类
c0-methodName=checkUserExits// 方法名
c0-id=358_1212542593797
c0-param0=string:%E6%B8%A9%E5%AE%B6%E5%AE%9D // 编码过的参数值
xml=true
后台返回的值:
头部
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/plain;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Wed, 04 Jun 2008 01:23:14 GMT
正文(responseText)是方法的执行结果
var s0="\u5BF9\u4E0D\u8D77, \u6B64\u7528\u6237\u540D\u4E0D\u5141\u8BB8\u6CE8\u518C";
DWREngine._handleResponse('358_1212542593797', s0);
BeanSoft@126.com (刘长炯)
http://beansoft.blogjava.net/
其他一些关于DWR的文章:
http://www.blogjava.net/ITdavid/archive/2008/03/14/186202.html
http://clarancepeng.javaeye.com/blog/146549
http://www.javaeye.com/post/403073
http://tmsoft.lsxy.com/index.php?id=600&load=read
The article is from: http://www.cnblogs.com/meetrice
This blogger is recording some code samples,technical skill of java,.Net,javascript, css, html for myself use. All articles are coming from my own experience and my collections which are from internet world. If you find any material have copy right issue please leave a comment to me. I will delete it immediately. These articles are writing in English or Chinese. Hope these information can help other technical guys. Thanks for reading.
Subscribe to:
Post Comments (Atom)
-
If you get "This page calls for XML namespace http://richfaces.org/a4j declared with prefix a4j but no taglibrary exists for that names...
-
Method 1: import oracle.sql.*; public class JClob { String tableName = null; // String primaryKey = null; // String primaryValue = null; // ...
-
1.HTTP-binding(ServiceMix) 1.4 各组件间传递消息流的过程如下: 1. HttpClient : Http 客户端运行一个独立的 Java 客户端程序,通过其中的 URLConnection 类连接到 http://...
No comments:
Post a Comment