본문 바로가기

Java

[taglibs]string-1.1.0, spring-modules-validation-0.9 syntax 오류 수정 wildfly-10.x(jboss EAP 7.x) 버전에서 syntax 오류 발생 string-1.1.0.jarspring-modules-validation-0.9.jar 첨부파일은 jar파일안의 tld 파일을 수정한 것이다 속성에 대한 value 값 수정된 부분 참고 수정된 string-1.1.0.jar의 taglib.tld 파일(spring-modules-validation-0.9.jar는 첨부파일 압축해제하여 확인)------------------------------------------------------------------------------------------------------------------ 1.1.0 1.1 string http://jakarta.apache.org/tag.. 더보기
[java]Calendar 사용법 자바에서는 날짜와 시간에 관련된 데이터를 쉽게 처리할 수 있도록 Calendar나 Date를 제공하는데, JSK1.0 부터 Date가 사용되었으나 JDK1.1 부터 보다 향상된 기능의 Calendar가 추가되었습니다. 이전 버전으로 작성된 코드와의 호환을 위해서 남겨두고 있지만, 가능하면 Date보다는 Calendar를 사용하는게 좋습니다. 그래도 간단한 날짜에는 Date 를 사용하는 것이 더 나을 수 있으며, 반드시 Date를 사용해야하는 경우도 있기때문에, Calendar와 Date간의 변환방법을 꼭 알아두어야 합니다. 1. Calendar를 Date로 변환 Calendar cal = Calendar.getInstance(); ... Date d = new Date(cal.getTimeInMillis.. 더보기
[암호화] JCA & JCE JCA & JCE1 설명가) JCA는 Runtime enviroment의 일부나) JCE는 JDK에 들어 있지 않은 JCA의 확장팩나) JDK는 JCA에 정의된 특정한 암호 함수만 사용 가능 2 JCA가) 전자 서명과 메시지 다이제스트 같은 기능에 대한 일반적인 API 제공 나) 주요 클래스들① MessageDigest② Signature③ KeyPaireGenerator④ KeyFactory⑤ CertificateFactory⑥ KeyStore⑦ AlgorithmParameters⑧ AlgorithmParameterGenerator⑨ SecureRandom 다) 암호 서비스 제공자 Sun Provider(Java 2 기준, sun.security.provider.Sun)① MD5 메시지 다이제스트② S.. 더보기
[spring]not found config set web-context Package Explorer -> Project 메뉴(우클릭) -> Spring tools -> spring project nature remove & add 끝! 더보기
[java]object byte 상호변환 Object 에서 byte[]ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(bos); out.writeObject(yourObject); byte[] yourBytes = bos.toByteArray(); byte[]에서 ObjectByteArrayIntputSream bis = new ByteArrayInputStream(yourBytes); ObjectInput in = new ObjectInputStream(bis); Object o = in.readObject(); 출처 : http://sdw8001.tistory.com/20 더보기
[java]한글 초성, 중성, 종성 분리 # 한글 - 초성, 중성, 종성 분리 import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class HangulDivide { // ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ private static final char[] CHO = {0x3131, 0x3132, 0x3134, 0x3137, 0x3138, 0x3139, 0x3141, 0x3142, 0x3143, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e}; //ㅏㅐㅑㅒㅓㅔㅕㅖ ㅗ ㅘ ㅙ ㅚ ㅛ .. 더보기
[rss feed view]Spring 3 MVC And RSS Feed Example http://www.mkyong.com/spring-mvc/spring-3-mvc-and-rss-feed-example/ 더보기
[spring][quartz]cron 실행주기 설정 Cron의 실행주기를 설정하는 방법* * * * * * * 왼쪽부터 초 분 시간 일(Day of Month) 월 요일(Day of Week, 1-7 : SUN-SAT) 년도(생략가능) 의 순이다. 표현식* : 모든 값 ? : 특정 값 없음 - : 범위 지정 , : 여러 값 지정 구분에 사용 / : 초기값과 증가치 설정에 사용 L : 지정할 수 있는 범위의 마지막 값 W : 월~금요일 또는 가장 가까운 월/금요일 # : 몇 번째 무슨 요일 2#1 => 첫 번째 월요일예제)"0 0 12 * * ?" 매일 정오 12시에 실행 "0 15 10 ? * *" 매일 오전 10시 15분에 실행 "0 15 10 * * ?" 매일 오전 10시 15분에 실행 "0 15 10 * * ? *" 매일 오전 10시 15분에 실행 .. 더보기
[regex]JAVA 정규표현식을 이용한 패턴매칭(HTML 제거) JAVA 정규표현식을 이용한 패턴매칭(HTML 제거) JAVA 에서도 정규표현식을 이용하여 패턴매칭이 가능하다. 다음은 정규표현식을 사용하여, 숫자와 영문을 제거하는 소스코드이다. 소스코드 import java.util.regex.*; .... private String removeChar(String inp){// 띄어쓰기 제거String tmp = inp.replaceAll(" ", ""); // 숫자 제거 tmp = this.removeRex("[0-9]", tmp); // 영문 제거 tmp = this.removeRex("[a-zA-Z]", tmp); return tmp; }// 패턴 제거private String removeRex(String rex, String inp){Pattern numP.. 더보기
[spring]WebContextFactory 1.HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); 2. 3.ApplicationContext ac = ContextLoader.getCurrentWebApplicationContext();RelayService relayService = (RelayService)ac.getBean("relayService"); 더보기
[java]한글 인코딩 변환 체크 한방에 끝내기 System.out.println("utf-8 -> euc-kr : " + new String(word.getBytes("utf-8"), "euc-kr"));System.out.println("utf-8 -> ksc5601 : " + new String(word.getBytes("utf-8"), "ksc5601"));System.out.println("utf-8 -> x-windows-949 : " + new String(word.getBytes("utf-8"), "x-windows-949"));System.out.println("utf-8 -> iso-8859-1 : " + new String(word.getBytes("utf-8"), "iso-8859-1"));System.out.println("is.. 더보기