- 浏览: 281950 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
cheetah_ysc:
不错不错,我喜欢!
Java固定时间间隔执行 -
voyage_mh:
阿选百度竟然一下可以吧你百度出来
使用DWR注解Annotation
一下的程序都是在引用util.js文件的情况下运行的
处理列表:处理列表--字符串数组
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>处理列表--字符串数组</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript">
var strArray = ['请选择一本书','Java','Hibernate','Spring',];
function add(){
dwr.util.addOptions("test",strArray);
}
function del(){
dwr.util.removeAllOptions("test");
}
</script>
</head>
<body>
<select id="test"></select>
<input type="button" value="添加选项" onclick="add();">
<input type="button" value="删除选项" onclick="del();">
</body>
</html>
处理列表--对象数组
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>处理列表--对象数组</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript">
var objArray = [{name:'Java'},
{name:'Hibernate'},
{name:'Spring'}];
function add(){
dwr.util.addOptions("test",objArray,"name");
}
function del(){
dwr.util.removeAllOptions("test");
}
</script>
</head>
<body>
<select id="test"></select>
<input type="button" value="添加选项" onclick="add();">
<input type="button" value="删除选项" onclick="del();">
</body>
</html>
处理列表--使用对象作为属性值的对象
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>处理列表--使用对象作为属性值的对象</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript">
//定义一个每个属性值都是对象的对象
var objMap = {
first:{book:'Java',price:'55'},
second:{book:'Hibernate',price:'66'},
third:{book:'Spring',price:'77'},
fourth:{book:'Struts2',price:'88'}
};
function add(){
//对象数组为列表框添加列表项
//以第三个参数指定的属性作为各列表项的值(value)
//以第四个参数指定的属性作为各列表项的文本
dwr.util.addOptions("test",objMap,"price","book");
}
function del(){
//删除所有的列表项
dwr.util.removeAllOptions("test");
}
</script>
</head>
<body>
<select id="test"></select>
<input type="button" value="添加选项" onclick="add();">
<input type="button" value="删除选项" onclick="del();">
</body>
</html>
处理列表--对象
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>处理列表--对象</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript">
//定义一个JavaScript对象
var book = {
name:"Java",
price:"55",
publish:"长沙"
}
function add(){
dwr.util.addOptions("test",book);
}
function del(){
dwr.util.removeAllOptions("test");
}
</script>
</head>
<body>
<select id="test"></select>
<input type="button" value="添加选项" onclick="add();">
<input type="button" value="删除选项" onclick="del();">
</body>
</html>
util.js测试
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>util.js测试</title>
<meta name="website" content="http://www.crazyit.org" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="js/util.js" type="text/javascript"></script>
</head>
<body>
<ol id="test"></ol>
<input type="button" value="添加选项" onclick="add();"/>
<input type="button" value="删除选项" onclick="del();"/>
<script type="text/javascript">
//定义一个对象数组
var objArr = [ {
name : 'Java'
}, {
name : 'Ajax'
}, {
name : 'XML'
} ];
function add() {
//以对象数组为列表框添加列表项
dwr.util.addOptions("test", objArr, 'name');
}
function del() {
//删除所有列表项
dwr.util.removeAllOptions("test");
}
</script>
</body>
</html>
util.js测试二
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>util.js测试</title>
<meta name="website" content="http://www.crazyit.org" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="js/util.js" type="text/javascript"></script>
</head>
<body>
<ol id="test"></ol>
<input type="button" value="添加选项" onclick="add();"/>
<input type="button" value="删除选项" onclick="del();"/>
<script type="text/javascript">
//定义一个对象数组
var objArr = [ {
book : 'Java',price:'55'
}, {
book : 'Ajax',price:'66'
}, {
book : 'XML',price:'77'
} ];
function add() {
//以对象数组为列表框添加列表项
//以第三个参数指定的属性作为各列表的文本
//第四个参数已经没用用了
dwr.util.addOptions("test", objArr, 'book','price');
}
function del() {
//删除所有列表项
dwr.util.removeAllOptions("test");
}
</script>
</body>
</html>
发表评论
-
DWR反向Ajax的一个简单Web聊天
2010-12-02 17:32 2444web.xml文件的配置 <?xml version= ... -
DWR反向Ajax技术
2010-12-02 17:29 1788常规的Web应用和通常的Ajax应用都要满足“请求--响应”模 ... -
使用DWR注解Annotation
2010-12-02 17:21 2870Struts 2,Spring,Hibernate 都可以使用 ... -
DWR整合Spring
2010-12-02 17:12 994Spring容器中的Bean可以被DWR使用:既然使用到了Sp ... -
DWR访问Servlet API
2010-12-02 17:07 1492DWR提供两种方式访问Servlet API: 使用W ... -
DWR中util.js访问HTML元素值
2010-12-02 17:00 1091访问HTML元素的值,只用getValue(elementID ... -
DWR中util.js处理表格
2010-12-02 16:54 1086util.js测试一(动态添加表格),使用dwr.util.a ... -
DWR中的util.js的使用----处理表格
2010-12-02 16:52 1101util.js测试一(动态添加表格),使用dwr.util.a ... -
DWR使用engine.js
2010-12-02 16:39 8161DWR框架会自动生成两个 ... -
DWR将客户端参数传递到回调函数
2010-12-02 16:18 1377web.xml文件配置 <?xml version=& ... -
DWR使用JSON格式的回调
2010-12-02 16:13 1259web.xml文件 <?xml version=&qu ... -
DWR调用客户端Java代码的程序实例
2010-12-02 16:10 1293//-------------发送简单字符串参数,返回普通 ... -
使用DWR的一个小程序
2010-12-02 16:03 1057一,将两个jar包加到lib下dwr.jar,commons- ... -
DWR框架简介
2010-12-02 15:54 1063DWR(Direct Web Remoting)是 ...
相关推荐
dwr包.rar dwr.jar engine.js util.js dwr-noncla.jar readme.txt JAR File: dwr.jar (1.08Mb) To DWR enable your web-app WAR File: dwr.war (4.62Mb) Demos/Examples of what DWR can do Sources: dwr-...
dwr javascript util.js engind.js 工具库 原js文件在dwr.jar中,不想找的同学就下载吧。
DWR(包括engine.js+util.js).rar
dwr教程+dwr.jar+util.js+engine.js
开发Dwr所需的jar包,js文件:dwr.jar engine.js util.js
NULL 博文链接:https://yxwang0615.iteye.com/blog/981848
dwr-1.1.1-util.js
第5章.DWR中的JavaScript简介,含4小节;第6章.engine.js的功能,含3小节;第7章.util.js的功能,含13小节;第8章.DWR进阶,含5小节;第9章.范例精讲——购物车,含8小节;第10章.附录,含常见问题(4节)和JavaScript高级...
dwr需要的js(searchaAuthor+engine.js+util.js).rar
dwr-2.0-util.js
dwr 例子 jar包 engine.jsutil.js 学习笔记 绝对超值。
dwr城市选择的联动,util.js方法的使用,动态table
这是dwr需要的engine.js和util.js,Engine.js与util.js不同之处在于,util.js是静态js文件,可以直接从jar文件中拿出来,页面可以直接引用;而engine.js则有部分动态内容,这决定了它必须经过servelt资源请求,在...
自己整理的dwr中util.js的常用方法
springboot整合dwr实现js调用java方法,页面支持freemarker和jsp
util.js包含一些有用的函数function,用于在客户端页面调用,它可以和dwr分开,独立营用于你的系统中。 主要功能如下: 1、$() 获得页面参数值 2、addOptions and removeAllOptions 初始化下拉框 3、addRows and...
技术分享:DWR 处理各种form表单Selectoption,table等,List,Bean
engine.js 功能 47 6.1 使用选项 47 6.2 选项索引 48 6.2.1 处理器(Handler) 48 6.2.2 调用处理器(Call Handler) 48 6.2.3 Hooks (一个batch中可以注册多个hook) 49 6.2.4 全局选项(在单次...