- 博客(7)
- 收藏
- 关注
原创 使用RestTemplate发送post请求
RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); header
2018-02-06 12:49:59
851
原创 中文转UTF-8
String me = "中文"; try { me = URLDecoder.decode(me, "UTF-8"); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); }
2017-11-02 10:39:41
432
原创 JavaBean中Integer类型为null时,转为json依然为null
JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerDefaultValueProcessor(Integer.class, //定义Integer为null时 转为json 还是null new DefaultValueProcessor(){ public Object getDefaultValue
2017-11-01 08:41:40
2267
转载 java快速排序
public static void main(String[] args) { int[] src = { 49, 38, 65, 97, 76, 13, 27, 49, 78, 34, 12, 64, 5, 4, 62, 99, 98, 54, 56, 17, 18, 23, 34, 15, 35, 25, 53, 51 }; S
2017-10-31 10:21:14
172
原创 通过java反射机制,获取单例模式中的方法
饿汉试单例模式public class HelloWorld { private HelloWorld(){}; private static HelloWorld hell = new HelloWorld(); public static HelloWorld getHello(){ return hell; }
2017-10-25 09:24:34
5361
转载 两次调用encodeURI来解决乱码问题(通过encodeURI解决乱码问题)
.encodeURL函数主要是来对URI来做转码,它默认是采用的UTF-8的编码.. UTF-8编码的格式:一个汉字来三个字节构成,每一个字节会转换成16进制的编码,同时添加上%号.假设页面端输入的中文是一个“中”,按照下面步骤进行解码1.第一次encodeURI,按照utf-8方式获取字节数组变成[-28,-72-83],对字节码数组进行遍历,把每个字节转化成对应的16进制数
2017-10-19 11:45:15
1745
原创 Expecting "jsp:param" standard action with "name" and "value" attributes
报错代码如下: 解决方法:去掉标签中的所有注释
2017-10-19 08:38:05
410
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人