Monthly Archives: กันยายน 2015

spring @Async

1. Overview In this article we’ll explore the asynchronous execution support in Spring – and the @Async annotation. Simply put – annotating a method of a bean with @Async will make it execute in a separate thread i.e. the caller will not wait … Continue reading

Posted in java | Leave a comment

spring jeditCluster

import redis.clients.jedis.JedisCluster; Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>(); //Jedis Cluster will attempt to discover cluster nodes automatically jedisClusterNodes.add(new HostAndPort("127.0.0.1", 6387)); jedisClusterNodes.add(new HostAndPort("127.0.0.1", 6388)); jedisClusterNodes.add(new HostAndPort("127.0.0.1", 6389)); jedisCluster = new JedisCluster(jedisClusterNodes); jedisCluster.set(key,value); jedisCluster.setex(key,expires,value); jedisCluster.get(key); jedisCluster.del(key);

Posted in java | Leave a comment

corner ribbon

http://jsfiddle.net/H6rQ6/15846 http://www.cssportal.com/css-ribbon-generator/ http://www.designcouch.com/home/why/2013/03/21/pure-css-ribbon-banner/

Posted in knowledge | Leave a comment

java sha1 equivalent to php

 public String sha1(String data) {         try {             // Create MD5 Hash             MessageDigest digest = java.security.MessageDigest.getInstance("SHA-1");             digest.update(data.getBytes("UTF-8"));     … Continue reading

Posted in java | Leave a comment

spring use utf-8 in resource properties

application.properties spring.config.forgetpassword.email.th.subject: ใช้ภาษาไทยในไฟล์พร็อพเพอร์ตี้ @Service public class SomeServiceImpl implements SomeService { @Autowired Environment env;    public String test(Map<String,String> inputvalidate)  {        return env.getProperty("spring.config.forgetpassword.email.th.subject").getBytes("ISO-8859-1"), "UTF-8")   } }

Posted in java, spring boot | Leave a comment