DWR is an Ajax remoting framework for Java to make it easy for web pages to interact with Java classes.
DWR 是一个用于改善web页面与Java类交互的远程服务器端Ajax框架.
Asynchronous FileUpload
文件的异步上传
This is an example of uploading files via DWR
此实例演示了怎么样通过DWR上传文件
Please select an image and a text file for uploading.A simple transform will take the image a scale it to 200 pixels square, and emboss on it the text from the uploaded file.
请选择上传的图片和文本文件.一个微妙的变化将会把图片的比例尺变成200像素的正方形,同时将上传文件的原文内容浮雕到图片上.
this example shows image manipulation
此实例向用户展示了怎样进行图像处理
this time with custom PDF generation
此次将会有一个自定义的PDF生成
Binary file handling
二进制文件的处理
source
源代码
A demonstration of uploading files and images
一个文件和图片上传的示例
Take 2 uploaded files and return an image based on them
获取上传的两个文件,并且基于此生成一个图片
The uploaded image
上传的图片
The selected color
选用的颜色
A mangled image based on the 2 uploaded files
基于两个上传文件生成的画质受损的图片
The altered image
改变后的图片
Voodoo to scale the image to 200x200
将图片的比例尺变成 200x200像素
The text to write on the image
写到图片上的文字
And scrawl the text on the image in 10 rows of 20 chars
将文本内容涂鸦到图片上,每行20个字符,填充10行
DWR automatically converts files from the browser to instances of
<code>org.directwebremoting.export.FileUpload</code> using the "file"
converter.
DWR使用"文件"转换工具自动将浏览器上传的文件转换成<code>org.directwebremoting.export.FileUpload</code>类的一个实例.
When you click on the Upload button the browser calls the
<code>uploadFiles()</code> function, which simply gets the values from the
3 input elements and passes them up to DWR:
当你点击上传按钮时浏览器会调用<code>uploadFiles()</code>函数,它只是简单的获取3个input元素的值,并将其转交给DWR:
dwr.util.getValue()</code> is a utility to get the value of any
element, in this case a file object.
<code>dwr.util.getValue()</code>是一个获取任意元素值得工具,在元素是文件对象的情形下.
On the server, DWR calls the <code>FileUploader.uploadFiles()</code> Java
method, which has the following signature:
在服务器端,DWRS 将调用<code>FileUploader.uploadFiles()</code> Java方法,它的方法签名如下:
Transform the image by scaling it and writing the text onto the image
按比例尺转换图片,并将文本内容写入到图片上.
And that's basically it. See the full source for how to resize using an AffineTransform and
write text onto an image, it's got nothing to do with DWR, so we can skip it for now.
The Java code returns the image which DWR converts and passes it to the callback in the
JavaScript which simply updates the image in the web page:
基本情况就是上面描述那样,详情请参考怎样使用Affine转换完整的源代码
Please enter some text to make part of a PDF download.
请输入一些文本内容作为下载PDF的一部分.
This is an example of downloading files via DWR
此实例演示了怎么样通过DWR下载文件
Text for PDF file:
PDF文件内容:
The client code simply gets the value of the input text field and sends it to the UploadDownload.downloadPdfFile() server function, and when the server replies with a PDF file, we open it for download.
客户端代码简单的获取了输入框文本域的内容,并且将它发送给服务器端的UploadDownload.downloadPdfFile()函数,
当服务器端反馈回一个PDF文件的时候,我们就可以点击下载了.
The server function uses iText to create a PDF file, and returns it in a FileTransfer object:
服务器端函数使用 iText创建一个PDF文件,同时将它以一个"文件传输者(FileTransfer)"对象的形式返回:
Overview
概要
Ajax Search Demo
Ajax搜索功能演示
This demo allows you to filter the data in a table.
此演示文档允许你对表格中的数据进行过滤
We use <code>person.name.replace</code> to highlight the matches.
我们使用了<code>person.name.replace</code>对匹配的数据高亮显示.
Found rows are added to the page using <code>dwr.util.addRows</code>:
查找到的数据会用<code>dwr.util.addRows</code>添加到页面:
Please enter a search filter
请输入一个搜索关键字
The server code simply searches the data using a RegEx
此服务端代码使用了正则表达式完成了数的简单搜索
On each change to the filter field we either call the server function
<code>People.getMatchingFromLargeCrowd()</code> to find matches, or, if
we have already found a set of matches, we filter that set if this makes sense.
每次关键字域内容发生变化时,程序会自动调用服务器
端<code>People.getMatchingFromLargeCrowd()</code>方法查找匹配的数据;
如果事先已经查找到一些数据集的话,就将有意义的数据集筛选出来填充到表格中.
Getting Started with DWR
DWR入门:
Editable Table
可编辑表格
Client side script
客户端脚本
configuration / test pages
配置/测试 页面
The generated <a href='dwr/'>配置/测试 页面</a> show how DWR is setup.
生成的 <a href='dwr/'>配置/测试 页面</a> 展示了DWR的内部配置情况.
Documented examples of how DWR works
以下是阐述DWR怎样运行的一些例程:
Start with updating some simple text and then including one page in another
Start with <a href="simple/text.html">updating some simple text</a>
and then <a href="simple/resource.html">including one page in another</a>
让我们就从 <a href="simple/text.html">简单的文本更新 </a>和
<a href="simple/resource.html">嵌入一个外部页面</a> 开始吧.
More visual 更多可视化效果
allows a user to edit a table of data
允许用户对表格数据的进行编辑
or you can <a href="people/search.html">search similar data
或者你也可以进行<a href="people/search.html"> 相似数据的搜索
Using JSON
JSON的使用
DWR supports JSONP and JSON-RPC, see the <a href="json/index.html">JSON-RPC version of the simple text demo</a></li>
DWR支持 JSONP 和 JSON-RPC,参见<a href="json/index.html">JSON-RPC 版的 普通文本演示</a></li>
Interesting <strong>Blogs
趣味 <strong>博客
Mailing lists
邮件列表
Documentation
文献
DWR lead
DWR项目核心人物
DWR Development
DWR的发展
Javadoc / Generated Docs
Javadoc / 生成文档
blogs about integrating DWR with other projects
关于DWR与其他项目进行集成开发的博客
DWR与其他项目的集成
Dynamically Updating Text
Chat examples one with the logic in JavaScript, and the other with logic in Java
聊天室的例子 逻辑上来说,一个用Javascript,另一个当然是用Java了
Home of DWR Support
DWR技术支持中心
Comet development
技术研发部
Your Message
信息
Sending a Message
发送消息
A clock that is updated by the server using ReverseAjax. Demonstrates access from a non-http thread
使用服务器端Ajax反转引擎即时更新时钟
Using <strong>Reverse Ajax</strong> to broadcast data
使用 <strong>Ajax反转引擎</strong>进行消息传递
Demonstrates access from a non-http thread
无http线程依赖性
Creating a clock in a web page is easy, but what about a clock controlled by
the server? This demo shows how use use a separate server side thread to control
a number of browsers.
我们可以很容易的在Web页面上创建一个时钟,但是怎样创建一个由服务器控件的时钟呢?
这个例程演示了怎样使用与服务器切断联系的线程来控制众多浏览器的时钟.
Virtually none. Other than setting up the tabs, all we do is to turn
active Reverse Ajax on: <code>dwr.engine.setActiveReverseAjax(true)
实际上并没有什么玄机,与填充文本框不同是:我们只要
调用<code>dwr.engine.setActiveReverseAjax(true)</code>激活Ajax反转引擎就可以了.
Reverse Ajax will work without comet, by using piggyback,
however this gives you very long latency,
not what we need for a clock,
so we turn on comet or polling (whatever the server is configured to prefer).
Reverse Ajax将会持续工作,
The server code uses a ScheduledThreadPoolExecutor to call update the
screen once a second. The setClockDisplay looks like this:
服务器端代码使用ScheduledThreadPoolExecutor命令屏幕每秒更新一次.
<code>setClockDisplay()</code>方法的原型如下:
Called from
没有合适的资源?快使用搜索试试~ 我知道了~
dwr官方中文入门教程
共744个文件
gif:205个
js:189个
xml:96个
需积分: 13 7 下载量 70 浏览量
2015-11-15
19:27:45
上传
评论
收藏 4.18MB RAR 举报
温馨提示
DWR作为一个优秀的服务器端ajax框架。特点是非常突出的。3.0版又增加了一些新的功能。
资源推荐
资源详情
资源评论
收起资源包目录
dwr官方中文入门教程 (744个子文件)
CallCenter.class 9KB
RandomData.class 5KB
JettyLauncherBase.class 4KB
UploadDownload.class 4KB
Simulator.class 4KB
People.class 3KB
Reverse.class 3KB
Call.class 3KB
Corporation.class 2KB
Person.class 2KB
TomcatDemoLauncher.class 2KB
ConvertedCountries.class 2KB
JettyLauncherBase$1.class 2KB
Clock.class 2KB
Corporations.class 2KB
Publisher.class 2KB
JettyLauncherBase$2.class 1KB
JavaChat.class 1KB
JavascriptChat.class 1KB
Countries.class 1KB
Simulator$1.class 1KB
Publisher$1.class 1KB
Demo.class 1KB
JavaChat$1.class 954B
CallCenter$1.class 954B
JavascriptChat$1.class 948B
Country.class 875B
Clock$1.class 856B
Intro.class 823B
Reverse$1.class 797B
Message.class 794B
JettyDemoLauncher.class 781B
CallCenter$2.class 683B
storeDemo.css 82KB
tundra.css 65KB
JSX.css 22KB
JSX.css 22KB
JSX.css 22KB
menu.css 6KB
TabContainer.css 4KB
Slider.css 4KB
container.css 4KB
Editor.css 3KB
calendar.css 3KB
Button.css 3KB
button.css 3KB
reset-fonts-grids.css 3KB
grids.css 3KB
Dialog.css 3KB
generic.css 3KB
Calendar.css 3KB
grids-min.css 2KB
Common.css 2KB
tree.css 2KB
tabview.css 2KB
logger.css 2KB
dojo.css 2KB
Toolbar.css 2KB
Common.css 2KB
border_tabs.css 2KB
Tree.css 1KB
Menu.css 1KB
TitlePane.css 1KB
TimePicker.css 1KB
AccordionContainer.css 1KB
RadioButton.css 1KB
Checkbox.css 1KB
datatable.css 1001B
BorderContainer.css 840B
Tree_rtl.css 800B
SplitContainer.css 799B
fonts.css 788B
Slider_rtl.css 779B
tabs.css 751B
TabContainer_rtl.css 739B
dnd.css 681B
ProgressBar.css 595B
reset.css 595B
reset-min.css 587B
ContentPane.css 537B
fonts-min.css 416B
yui-demo.css 356B
Editor_rtl.css 310B
customize.css 288B
customer.css 195B
Menu_rtl.css 183B
Calendar_rtl.css 155B
Common_rtl.css 155B
ColorPalette.css 105B
TitlePane_rtl.css 99B
Dialog_rtl.css 92B
logo.gif 7KB
select_a.gif 6KB
select.gif 6KB
select.gif 6KB
select.gif 6KB
select.gif 6KB
editorDisabled.gif 4KB
editorDisabled_rtl.gif 4KB
editor.gif 4KB
共 744 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
wkhopeful
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tinymce 多图片批量上传插件
- Virtualized Hadoop Performance with VMware vSphere 6 on Servers
- 基于java开发的驾校学员信息管理系统
- 电气类117、变电站真实巡检电力设备检测数据集(7500多张+15类+YOLO格式txt标签)-第二部分
- 智能图像处理应用案例介绍:开发基于Java的智能图像处理应用,包括图像识别、图像增强等功能
- HTML 和 JavaScript 创建一个端午节的祝福页面.docx
- 电气类、117.变电站真实巡检电力设备检测数据集(7500多张+15类+YOLO格式txt标签)-第一部分
- IMG_20180720_124347_01.jpg
- IMG20240621095811.jpg
- jQuery 库.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功