Java - 使用 XSD 校验 XML
摘要:package com.huey.dream.utils;import java.io.IOException;import java.io.InputStream;import javax.xml.transform.Source;import javax.xml.transform.stream...
阅读全文
posted @
2015-06-25 21:47
huey2672
阅读(2702)
推荐(0) 编辑
Json-lib - java.util.Date 转换问题
摘要:使用 JSON-lib 将 java.util.Date 对象直接转换成 JSON 字符串时,得到的通常不是想要格式:System.out.println(JSONSerializer.toJSON(new Date()));// {"date":24,"day":3,"hours":12,"min...
阅读全文
posted @
2015-06-24 12:59
huey2672
阅读(340)
推荐(0) 编辑
CXF(2.7.10) - RESTful Services, JSON Support
摘要:在CXF(2.7.10) - RESTful Services介绍了 REST 风格的 WebService 服务,数据传输是基于 XML 格式的。如果要基于 JSON 格式传输数据,仅需要将注解 @Produces("application/xml") 修改为@Produces("applicat...
阅读全文
posted @
2015-06-22 20:53
huey2672
阅读(504)
推荐(0) 编辑
CXF(2.7.10) - RESTful Services
摘要:1. 定义 JavaBean。注意 @XmlRootElement 注解,作用是将 JavaBean 映射成 XML 元素。 2. 定义服务接口。注意各个注解的作用。 3. 实现服务接口。 4. Spring 配置。 5. web.xml 配置。 6. 启动 Tomcat 运行 web 工程。 7.
阅读全文
posted @
2015-06-22 17:23
huey2672
阅读(481)
推荐(0) 编辑
CXF(2.7.10) - Writing a service with Spring
摘要:1.定义服务接口。package com.huey.demo.ws;import javax.jws.WebParam;import javax.jws.WebService;@WebServicepublic interface HelloService { public String sa...
阅读全文
posted @
2015-06-21 11:03
huey2672
阅读(292)
推荐(0) 编辑
CXF(2.7.10) - WSDL2Java generated Client
摘要:以调用http://www.webxml.com.cn/ 提供的IpAddressSearchWebService 服务为例。1. 使用 wsdl2java 工具,根据 wsdl 生成JAX-WS 客户端wsdl2java -client "http://webservice.webxml.com....
阅读全文
posted @
2015-06-19 16:25
huey2672
阅读(611)
推荐(0) 编辑
CXF(2.7.10) - A simple JAX-WS service
摘要:1. 下载 apache-cxf-x.x.x.zip,在工程导入依赖的 jar 包。也可以基于 Maven 构建工程。2. 定义服务接口。package com.huey.demo.ws;import javax.jws.WebParam;import javax.jws.WebService;@W...
阅读全文
posted @
2015-06-19 15:27
huey2672
阅读(381)
推荐(0) 编辑
Cryptography - JavaScript 加密算法库
摘要:Example 1: The following example uses aes function.Example 2: The following example uses aes function with passphrase.Example 3: The following example...
阅读全文
posted @
2015-06-11 23:34
huey2672
阅读(785)
推荐(0) 编辑
JavaScript - Base64 编码解码
摘要:以下代码摘自:http://cryptojs.altervista.org/encoding/Base64.htmlfunction base64_encode(str) { if (window.btoa) // Internet Explorer 10 and above retur...
阅读全文
posted @
2015-06-11 23:14
huey2672
阅读(503)
推荐(0) 编辑