본문 바로가기

개발개발

Tomcat8에서 getRealPath() 값이 NULL일때 관리하던 시스템을 Tomcat7 에서 Tomcat8로 변경했는데 getRealPath() 에서 NULL 을 반환하기 시작한다. 검색해보니 / 로 경로를 시작하라고하던데 난 이미 그렇게 적용되어 있었음.원인은 해당 경로가 심볼릭링크 였기 때문. tomcat8에서 심볼링링크 적용 정책이 변경된것같다. 톰캣설정중 context 부분을 변경해주면된다.심볼링링크 관련해서 검색을하면 대부분 tomcat7 방법이 나오더라. tomcat7과 tomcat8 적용 방법이 다르니 유의할것. tomcat7 tomcat8 ... 더보기
module ssl_module is built-in and can't be loaded 아파치 세팅하다가 "module ssl_module is built-in and can't be loaded" 라는 에러를 만났다.이게뭔가 싶어 한참 검색을 해봐도 모르겠더라. 그래서 곰곰히 뜻을 생각해보다가 built-in 이라는 단어에 꽂혔다. 아파치 설치할때 줬던 옵션이 "./configure -prefix=/sjinc/apache2.2 --enable-rewrite --enable-proxy --enable-so --enable-mods-shared --enable-rewrite --enable-deflate --with-ssl=/usr/local/openssl --enable-ssl --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util" .. 더보기
Simple Logging Facade for Java SLF4J는 java.util.logging나 log4j같은 다양한 자바 로깅 프레임워크에 대해 간단한 facade를 제공한다. 일반적으로 common-logging 에서 로깅을 사용하는 방법은 다음과같다. logger.debug(this.getClass().getName() + "|" + forwardPage.getName() + "|" + (System.currentTimeMillis() - time)); 이대로 방치하면 debug 수준의 로그를 원치 않을때에도 .debug() 메소드가 동작을 하면서 문자열을 생성한다. 문자열에 대한 처리는 상당히 오버헤드가 크므로 이를 해결하기 위해서 다음처럼 코드를 작성한다. if (logger.isDebugEnabled()) { logger.debug(this... 더보기
context binding 자바스크립트에서 모든 메서드(함수)와 변수는 컨텍스트를 가진다. 컨텍스트는 메서드와 변수가 속해 있는 객체를 가리킨다고 생각하면 될듯하다. 예를들면, function test(){ alert('test'); } test()의 컨텍스트는? BOM(Browser Object Model)의 전역객체인 window다. 객체의 컨텍스트에는 this 키워드를 통해서 접근할 수 있는데, 다음 코드를 보면 쉽게 이해가 된다. function test(){ //여기서 this 는 브라우져 전역 객체 window를 가리킨다. for( var name in this){ alert(name + ':' + this[name]); } } //호출하게되면 window객체의 모든 프로퍼티가 출력된다. test(); test()를 실.. 더보기
self-executing anonymous function 자바스크립트에서는 함수 선언(function declaration)과 함수 표현식(function expression) 두가지 방법으로 함수를 만들 수 있다. 함수 선언은 다음과 같다. //함수 선언 function function_name() { ...some code... } //함수호출시 function_name(); 함수 표현식은 함수명 없이 function 키워드만으로 이루어져 있는데, 요런 형태를 이름이 없는 함수(nameless function) 또는 익명함수(anonymous function)라고 한다. //함수표현식 function(){ ...some code... } 함수 표현식은 이름이 없으므로 함수 이름을 통해 호출할 수가 없지만, 함수 표현식 뒤에 바로 ()를 붙여서 선언된 곳에서.. 더보기
@SuppressWarnings("unchecked") does not ignore raw types warnings anymore What is affected: Usage of @SuppressWarnings("unchecked"). Description: Up to Eclipse 3.5, @SuppressWarnings("unchecked") was used to suppress the unchecked and raw types warnings. This was not consistent with other compilers (e.g. javac). A new warning token "rawtypes" has been added to cover the case of raw type warnings exclusively. So in order to get rid of all warnings, in Eclipse 3.6, it m.. 더보기
Dynamic Web Module? 이클립스에서 다이나믹 웹 프로젝트를 생성 하면 Dynamic Web Module 이랑 항목이 있다. 이것이 무엇인고~ 하니, 서블릿 스펙인 듯하다. 톰캣 버전에 따라(정확히는 서블릿 컨테이너의 지원에 따라) 지원가능한 서블릿 버전의 목록은 다음과 같다. Servlet/JSP Spec Apache Tomcat version Actual release revision Minimum Java Version 3.0/2.2 7.0.x 7.0.21 1.6 2.5/2.1 6.0.x 6.0.33 1.5 2.4/2.0 5.5.x 5.5.33 1.4 2.3/1.2 4.1.x (archived) 4.1.40 (archived) 1.3 2.2/1.1 3.3.x (archived) 3.3.2 (archived) 1.1 사용할 .. 더보기
Oracle 날자 관련 함수 날자/시간 형식 날자/시간 형식은 특정한 문자열 패턴으로 표현된다. 패턴에 사용되는 문자는 다음과 같다. 날자/시간 패턴 문자 설명 CC Century SCC Century BC prefixed with - YYYY Year with 4 numbers SYYY Year BC prefixed with - IYYY ISO Year with 4 numbers YY Year with 2 numbers RR Year with 2 numbers with Y2k compatibility YEAR Year in characters SYEAR Year in characters, BC prefixed with - BC BC/AD Indicator * Q Quarter in numbers (1,2,3,4) MM Month .. 더보기