Web Programming
-
자바스크립트 디데이 구하기
Web Programming 2023. 2. 15. 00:45var today = new Date().getTime(); var dday = new Date("2023-03-21:17:20:00+0900").getTime(); var gap = dday - today; var result = Math.floor(gap / (1000 * 60 * 60 * 24)); var hour = Math.floor((gap % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var min = Math.floor((gap % (1000 * 60 * 60)) / (1000 * 60)); var sec = Math.floor((gap % (1000 * 60)) / 1000); console.log(result); console.log(hour); co..
-
자바 엑셀 다중시트 업로드 poi 4.1.2
Web Programming 2023. 2. 15. 00:40테스트한 엑셀 파일 확장자는 xlxs 이다. poi 4.1.2 버전은 xls, xlxs 두 개 다 가능하다고 알고 있지만 테스트는 xlxs로 진행했음 먼저 pom.xml 에 디팬던시 org.apache.poi poi 4.1.2 org.apache.poi poi-ooxml 4.1.2 JSP enctype 는 당연히 "multipart/form-data" 쓰고 jsp 에서 버튼 클릭 시 uploadExcel() 함수 호출하여 파일 첨부 후 /excelUpload.do 호출 function uploadExcel(){ if($("#upFile").val() == ''){ alert("업로드 할 엑셀 파일 먼저 첨부 바랍니다."); }else if( $("#upFile").val() != "" ){ var ext..
-
JAVA 자바 비밀번호 정규식 문자+특수문자+숫자 포함 9자리만 가능
Web Programming 2023. 2. 15. 00:09if(passwordParam.equals("changePwToNew")) { boolean sameCharCheck = false; String checkStr = ""; String returnMsg = ""; // 비밀번호 포맷 확인(영문, 특수문자, 숫자 포함 9자 이상 가능) Pattern passPattern = Pattern.compile("^(?=.*[A-Za-z])(?=.*\\d)(?=.*[~!@#$%^*_+|?:{}])[A-Za-z\\d~!@#$%^*_+|?:{}]{9,}$"); Matcher passMatcher = passPattern.matcher(password); // 연속된 문자 숫자4자리 포함 체크 int o = 0; int d = 0; int p = 0; int n = 0..
-
문자열 정규식 사이트 두곳
Web Programming 2023. 2. 15. 00:09https://regex101.com/ regex101: build, test, and debug regex Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET. regex101.com https://regexr.com/ RegExr: Learn, Build, & Test RegEx RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp). regexr.com /^ 와 $/gm 사이에 원하는 정규식을 넣고 Text 부분에 검증하고 싶..
-
JAVA 자바 배열for문 확장for문
Web Programming 2023. 2. 15. 00:07[sy] for(자료형 변수명 : 배열명){ 반복문장~ } [ex] class A{ public static void main(String args[]){ int[] array={10,20,30}; for(int num : array) System.out.println(num); } } an) 10 , 20 , 30 class B{ public static void main(String args[]){ String[] array={"aa","bb","cc"}; for(String str : array) System.out.println(str); } } an) aa, bb, cc