일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 도커
- 초기 세팅
- CentOS6
- ollama langflow
- docker 설치
- React
- 헤더 설정
- 리눅스
- MySQL
- generate entity
- SpringBoot
- JPA
- docker
- Java
- swagger
- memcached
- jvm
- dto valid
- Next.js 14
- NextJS
- jpa entity자동
- custom valid
- spring
- header setting
- spring boot
- generate pojos
- java9
- JavaScript
- java8
- 초기 구축
- Today
- Total
목록4. JAVA (76)
개발자의 길
Apache - SpringBoot(내장톰캣) 연동 개요 사내정보 시스템 SSO연동을 위해 Apache사용이 불가피함 Part1. mod_jk를 이용한 tomcat 연동(Apache설정) 사내에서 발급받은 서버에는 기본적으로 Apahce2.2가 설치되어 있어 Apahce설치과정은 생략한다. mod_jk를 설치과정 및 Apache설정은 다음과 같다. 1) tomcat-connectors설치 cd /usr/local/src wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.44-src.tar.gz tar -xzf tomcat-connectors-1.2.44-src.tar.gz 2) native 디렉토리로 이동 c..

참조문서 https://docs.spring.io/spring-security/site/docs/4.2.7.RELEASE/reference/htmlsingle/#getting-started http://springsource.tistory.com/80 https://okky.kr/article/382738 https://minwan1.github.io/2017/03/25/2017-03-25-spring-security-theory/ OKKY | 초보가 이해하는 스프링 시큐리티 저의 스프링 시큐리티 관련 예제는 깃허브 에서 제공합니다. (주석이 포함된 프로젝트는 주석이 너무 지저분하여 제외...) 1. 스프링 시큐리티란 무엇인가? 스프링 시큐리티를 이해하기 위해서 스프링 시큐리티가 무엇인지를 알아야합니다...
서버를 실행해 놓고, 실제적으로 여러 클라이언트가 다 붙어서 메세지를 주고 받는 형식이다. 이 방식으로 웹소켓용 서버를 띄워 놓고, db나 다른 액션이 있을때 마다 다른곳에서 서버로 전송하고, 다른 클라이언트에서 그 메세지를 받아서 동적으로 처리가 가능 할것 같다.. 밑에 예제는 완전 쌩짜로 만든거고 실제로 spring framework + jquery 조합으로는 stomp.js+sockjs.js 조합으로 이용하면, 하위 브라우저(websocket이 지원안되는) 까지 체크 해서 sockjs가 처리해줘서, 실무에선 해당 방식을 사용하길 권한한다. import java.io.IOException; import javax.websocket.OnClose;import javax.websocket.OnError;..
원본 이미지의 파일 경로를 가지고, 썸네일을 따로 저장하는 기능과, 저장없이 썸네일을 만들어서 뿌려주는 기능이다. /** * make jang.jae * imgUrl = 파일 경로 * w = 변경할 width, 없을경우 원본 사이즈 * h = 변경할 height, 없을경우 원본 사이즈 * outPath = 값이 있으면 해당 경로에 저장, 없으면 호출한 영역에 이미지 노출 */public void imgOnload(String imgUrl, String w, String h, String outPath, HttpServletResponse response) throws Exception{int extIndex = imgUrl.lastIndexOf(".");String fileExt = imgUrl.subs..
필터링(distinct(), filter()) 필터링은 중간 처리 기능으로 요소를 걸러내는 역할을 합니다. 필터링 메소드인 distinct()와 filter() 메소드는 모든 스트림이 가지고 있는 공통 메소드 입니다. 리턴 타입 메소드(파라미터) 설명 Stream IntStream LongStream DoubleStream distinct() 중복 제거 filter(Predicate) 조건 필터링 filter(IntPredicate) filter(LongPredicate) filter(DoublePredicate) distinct() 메소드는 중복을 제거하는 데, Stream의 경우 Object.equals(Object) 가 true 이면 동일한 객체로 판단하고 중복을 제거합니다. IntStream, L..
Iterablevoid forEach(Consumer
java8 부터는 JodaTime에 기반한 패키지가 포함되어 훨씬 간단하고 쉬운 방법으로 일자관련 기능을 사용할 수있습니다. 시스템의 밀리초 구하기.(국제표준시각(UTC, GMT) 1970/1/1/0/0/0 으로부터 경과한 시각) // 밀리초 단위(*1000은 1초), 음수이면 이전 시각long time = System.currentTimeMillis ( ); System.out.println ( time.toString ( ) ); -------------------------------------------------------------------------------------------------------------- 현재 시각을 가져오기. Date today = new Date (); Sys..
일단 파일의 임의의 위치에 접근하려면 RandomAccessFile 라는 클래스를 사용합니다.그리고 마지막 한 줄을 가져오려면 \n 문자를 뒤로부터 검색해서발견되는 위치 +1 부터 readLine 해주면 됩니다. 예문) RandomAccessFile file = new RandomAccessFile("A.txt","r"); long fileSize = file.length(); long pos = fileSize - 1; //뒤로 부터 while(true) { file.seek(pos); //파일 포인터 이동 if(file.readByte()=='\n') { //해당 위치의 바이트를 읽어 \n 문자와 같은지 검사 break; //같으면 멈춤 } pos--; //포인터 위치값 감소 (앞으로) } file...
static String aesKey = "ZCXVsfda2F"; //이건 내 맘대로 랜덤 /** * hex to byte[] : 16진수 문자열을 바이트 배열로 변환한다. * * @param hex hex string * @return */ public static byte[] hexToByteArray(String hex) { if (hex == null || hex.length() == 0) { return null; } byte[] ba = new byte[hex.length() / 2]; for (int i = 0; i < ba.length; i++) { ba[i] = (byte) Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16); } return ..
//csv 콤마로 구분하여 짜르기//안에 내용중 콤마가 있는 경우는 " 쌍따옴표로 감싸기 떄문에, 이 처리를 해주엇다.public static String[] csvSplit(String str){String[] resultStr=null;String result="";String[] a=str.split(",");int cnt=0;String temp="";for(int i=0;i0){cnt++;temp+=","+a[i].replaceAll("\"","");}else{result+=a[i];}}if(i!=a.length-1 && cnt==0)result+="|,|";}//System.out.println(result);resultStr=result.split("\\|,\\|");return result..