본문 바로가기

분류 전체보기362

Tomcat 방화벽 확인 1. telnet ip port 로 cmd 에서 쳐보기 telnet 128.129.230.1 12200 2. 내부 톰캣 떠있나 확인 webapps/ROOT/index.jsp 만들고 ‘hello’ 라고 찍고 webapps/ROOT/WEB-INF/web.xml index.jsp 3. wget http://localhost:port/index.jsp 가 받아지나 확인 4. IPTABLE-config 에 방화벽 포트 정보 있음. 2017. 11. 24.
Java Builder 패턴 Builder 패턴 - config 설정할 때 종종 쓰임. package builder; import java.util.HashMap; public class BuilderPatternExample { public static void main(String [] args) { Builder builder = $for("constructor") .with("configuration") .withAttribute("key", "value"); } public static Builder $for(String configuration) { return new Builder(); } public static class Builder { String configuration; HashMap attributes = .. 2017. 11. 24.
Java checked exception vs unchecked exception 1. Checked Exception Checked Exception 은 예외를 냈을 때 Caller 쪽에서 뭔가 Exception 에 관한 처리를 반드시 해야할 때 rollback 안됨 ex) Exception 2. Unchecked Exception Rollback 됨. RuntimeException 은 프로그래머의 부주의로 발생한 에러가 대부분 Exception 에 관한 처리는 안해도 되지만 인지는 하고 싶을 때 ex) RuntimeException, NullPointerException 2017. 11. 24.
Tomcat DataSource 비밀번호 암호화 (그 외 값들도 암호화 가능) ❇ 요약 server.xml 에 명시된 DataSourceFactory 를 Customizing 하여 데이터 소스의 비밀번호를 암호화한다. 1. Atomickos 데이터 소스 암호화 https://stackoverflow.com/questions/129160/how-to-avoid-storing-passwords-in-the-clear-for-tomcats-server-xml-resource-def 2. DataSource 암호화 - 기본적인 틀은 여기서 설명 http://www.jdev.it/encrypting-passwords-in-tomcat/ 2017. 11. 24.