일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- port
- Source
- find
- Windows
- vscode
- bash
- Windows 10
- 단축키
- Eclipse
- Mac
- GIT
- web.xml
- Quartz
- profile
- resource
- netsh
- maVen
- grep
- VirtualBox
- 줄바꿈 문자
- ssh
- import
- lsof
- plugin
- context
- xargs
- IntelliJ
- 네트워크
- tomcat
- JavaScript
- Today
- Total
목록Dev/Java (163)
develog
- Marker annotation ex) @MarkerAnnotation - Single-value annotation ex) @SingleValueAnnotation("some data") - Full annotation ex) @FullAnnotation(var1="data1", var2="data2", var3="value3")
1. 클래스 얻기 Object.getClass() UserVo vo = new UserVo(); System.out.println(vo.getClass()); .class System.out.println(UserVo.class); Class.forName("") try { System.out.println(Class.forName("vo.UserVo")); } catch (ClassNotFoundException e) { e.printStackTrace(); } 2. private field 셋팅 public class UserVo { private String name; public String getName() { return name; } } public static void main(String..
private void reflectionTest() { try { // get class Class clazz = Class.forName("vo.UserVo"); // create instance UserVo vo = (UserVo) clazz.newInstance(); // get field Field field = clazz.getDeclaredField("privateField"); // set field value field.setAccessible(true); field.set(vo, "aaaaaa"); // get field value String value = (String) field.get(vo); System.out.println(value); } catch (ClassNotFoun..
rm /tomcat/work/Catalina/도메인/_/org/apache/jsp/* ex) rm /tomcat/work/Catalina/www.mydomain.com/_/org/apache/jsp/*
Calendar cal = Calendar.getInstance();System.out.println(cal.getTimeInMillis());// 1348201513203 // 속도 더 빠름System.currentTimeMillis()// 1348201513203
interface JdbcTemplateHandler {public Object mapRow(String param, JdbcTemplateHandler handler);} class JdbcTemplate implements JdbcTemplateHandler {public Object queryForObject(String param, JdbcTemplateHandler handler) {System.out.println("query executing...");try {Thread.sleep(3000);} catch (InterruptedException e) {e.printStackTrace();}return mapRow(param, handler);}public Object mapRow(Strin..