DWR Converters
来源:互联网 发布:淘宝商城男运动鞋 编辑:程序博客网 时间:2024/05/16 00:37
Converters
The Converters
There are a number of converters that are defined and initialized for you. They are defined as follows:
<converter id="null" class="uk.ltd.getahead.dwr.convert.NullConverter"/><converter id="primitive" class="uk.ltd.getahead.dwr.convert.PrimitiveConverter"/><converter id="bignumber" class="uk.ltd.getahead.dwr.convert.BigNumberConverter"/><converter id="string" class="uk.ltd.getahead.dwr.convert.StringConverter"/><converter id="date" class="uk.ltd.getahead.dwr.convert.DateConverter"/><converter id="array" class="uk.ltd.getahead.dwr.convert.ArrayConverter"/><converter id="map" class="uk.ltd.getahead.dwr.convert.MapConverter"/><converter id="collection" class="uk.ltd.getahead.dwr.convert.CollectionConverter"/><converter id="bean" class="uk.ltd.getahead.dwr.convert.BeanConverter"/><converter id="hibernate" class="uk.ltd.getahead.dwr.convert.HibernateBeanConverter"/><converter id="dom" class="uk.ltd.getahead.dwr.convert.DOMConverter"/><converter id="dom4j" class="uk.ltd.getahead.dwr.convert.DOM4JConverter"/><converter id="jdom" class="uk.ltd.getahead.dwr.convert.JDOMConverter"/><converter id="xom" class="uk.ltd.getahead.dwr.convert.XOMConverter"/><converter id="servlet" class="uk.ltd.getahead.dwr.convert.ServletConverter"/>
The converters are merely defined here and are put into use with <convert ...> elements. There are 2 attributes in any convert element, a reference to a converter definition and a match line that defines the class(s) that it can convert.
For example the simplest converter is the null converter that converts void and null values to javascript null and undefined vales. This creator is the simplest of all. It assumes that you will be calling static methods only, so no object creation is needed.
By default DWR marshalls Java void values into Javascript nulls using the following: <convert converter="null" match="void"/>
. There are times when a java.lang.Void
needs to be converted as well so the same converter is used for those too: <convert converter="null" match="java.lang.Void"/>
. There is no danger in passing nulls from Java to Javascript so these definitions are made by default - you don't need to put them in the <allow> section yourself.
The primitive converter converts boolean, byte, char, etc as well as their Class based alternatives Boolean etc. The default setup includes 16 entries in the allow section for all primitive types along the following lines: <convert converter="primitive" match="java.lang.Long"/>
and <convert converter="primitive" match="long"/>
.
The string and date converters are also setup by default. We have not found any way to subvert Strings, Dates or basic numeric types so they are all turned on by default.
- DWR Converters
- dwr-converters
- dwr开发指南---Converters
- AutoMapper----Custom Type converters
- Retrofit自定义CONVERTERS(fastjson)
- dwr
- dwr
- dwr
- DWR
- DWR
- DWR
- dwr
- dwr
- DWR
- DWR
- DWR
- dwr
- dwr
- 这一段时间在搞音乐平台系统,在春节之前应该可以告一段落了,
- oracle常用SQL语句
- Linux网络接口源码导读
- Oracle编程的编码规范及命名规则
- php-5.1.1的安装步骤
- DWR Converters
- Spring对log4j的增强[转]
- 启动SpringSide--Promatic Enterprise Application KickStart项目[转]
- 〖原创〗如何实现程序自动关闭powerbuilder弹出的消息窗口?
- 拾“一月”的肖邦
- 基于“用java.util.*中的LinkedList实现stack” 2.0版
- 解决msn80048820问题的方法
- 理解java中的两类异常
- 2006好!