▼
2015年2月26日 星期四
2015年2月10日 星期二
[Java] Get Class Name
Class<?> enclosingClass = getClass().getEnclosingClass();
if (enclosingClass != null) {
System.out.println(enclosingClass.getName()); // the declaring class name
} else {
System.out.println(getClass().getName()); // this class is anonymous
}
Or,
String className = this.getClass().getSimpleName(); // if this is not
//an anonymous class, else return ""
http://stackoverflow.com/questions/6271417/java-get-the-current-class-name
[jQuery] Select More than One Element by Index Using .eq()
e.g
$('td', row).eq(0).addClass('strong text-info');
$('td', row).eq(1).addClass('strong text-info');
To combine the above as one line, add a jQuery plugin through (place anywhere in $(document).ready before using):
$('td', row).eqAnyOf([0,1]).addClass('strong text-info');
http://tiku.io/questions/581385/use-jquery-to-select-multiple-elements-with-eq
$('td', row).eq(0).addClass('strong text-info');
$('td', row).eq(1).addClass('strong text-info');
To combine the above as one line, add a jQuery plugin through (place anywhere in $(document).ready before using):
$.fn.eqAnyOf = function (arrayOfIndexes) {Then use the below codes:
return this.filter(function(i) {
return $.inArray(i, arrayOfIndexes) > -1;
});
};
$('td', row).eqAnyOf([0,1]).addClass('strong text-info');
http://tiku.io/questions/581385/use-jquery-to-select-multiple-elements-with-eq
2015年2月5日 星期四
[Spring mvc Interceptors] How to add interceptors in Java Config
What is Interceptor?
http://viralpatel.net/blogs/spring-mvc-interceptor-example/
Add autowired interceptors from Java Config
http://stackoverflow.com/questions/23349180/java-config-for-spring-interceptor-where-interceptor-is-using-autowired-spring-b
http://viralpatel.net/blogs/spring-mvc-interceptor-example/
Add autowired interceptors from Java Config
http://stackoverflow.com/questions/23349180/java-config-for-spring-interceptor-where-interceptor-is-using-autowired-spring-b