언어(32)
-
[ Java ] Can't create cache file! 오류 해결 방법
ImageIO 사용하다가 발생하는 경우가 있습니다. cache file을 생성할 수 없거나 cache file을 생성하는 경로가 올바르지 않을 경우 발생합니다. 간단한 조치 방법은 2가지입니다. 1. cache file 생성하지 않도록 수정 2. cache file 생성 경로 수정 1. cache file 생성하지 않도록 수정 ImageIO를 사용하는 부분 (ex : ImageIO.read(FileInputStream)) 앞에 다음과 같이 코드를 삽입합니다. ImageIO.setUseCache(false); cache 사용 여부를 명시적으로 설정하지 않은 경우 기본 값이 true이기 때문에 false로 해줍니다.\ 2. cache file 생성 경로 수정 경로에 한글이 들어가도 에러가 발생하는 경우가 있..
2022.01.04 -
[ Javascript ] 비밀번호 유효성 검사 정규식
비밀번호가 유효하게 작성되었는지 확인하는 방법입니다. 아래 함수는 비밀번호가 8~20자 사이에 길이를 갖고 있고 영문 대소문자, 숫자, 정규식에 나열되어 있는 특수문자에 포함될 경우 true를 리턴하는 함수입니다. 글자 길이가 8자 미만, 20자 초과 이거나 공백, 정규식에 없는 특수문자가 입력되었을 경우 false가 리턴됩니다. 정규식에 쓰이는 특수문자들은 그냥 쓰면 안 되므로 앞에 \를 붙여줘야 합니다. function checkPassword(pw) { var regexPw = /^[A-Za-z0-9`~!@#\/; if(!regexPw.test(pw)) { alert("8~20자 영문 대소문자, 숫자, 특수문자를 사용..
2021.12.28 -
EL태그 사용 시 Method name is matched but some parameters are not matched 오류 해결 방법
jsp에서 el태그를 다음과 같이 사용할 경우 에러 로그가 발생할 수 있습니다. list.get(0).namejavax.el.MethodNotFoundException:Methodnameismatchedbutsomeparametersarenotmatched다음과같이수정하면에러가발생하지않습니다.{list[0].name}
2021.11.18 -
[ JavaScript ] 페이지 이동 시 내용 변경 감지, readonly 값 변경 감지
function fn_beforeunload() { window.onload = function() { var isBeforeunload = false; ("input").on("propertychange change keyup paste input", function() { isBeforeunload = true; }); (window).on("beforeunload"). function() { if (isBeforeunload) return ""; }); (function ($) { var originalVal = .fn.val; .fn.val = function (value) { var res = originalVal.apply(this, arguments); if (this.is("inpu..
2021.03.24 -
[ JavaScript ] IE에서 Swiper 사용 시 주의 사항
Swiper 참조 swiperjs.com/ Swiper - The Most Modern Mobile Touch Slider Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior. swiperjs.com 이미지 슬라이더 구현 시 사용하는 모바일에 최적화되어 있는 js입니다. 무작정 사용하시면 5버전 이상일 거라 IE에서는 isNaN 함수 사용하는 부분에서 오류가 나므로 작동을 하지 않습니다. 이럴 땐 IE를 사용하지 못하게 하거나 swiper의 버전을 4버전 이하로 낮춰야 합니다. 아래 사이트 들어가서 4버전 이하의 zip을 다운로드하셔서 dist 폴더..
2021.02.15 -
[ Java ] 자바 - 저장된 이미지 파일 변환 후 사이즈 조정
변환할 확장자나 사이즈는 알맞게 수정하시면 됩니다. File file = new File(_파일경로_, _파일명_); File flTgt = new File(_생성경로_, _생성파일명_+".jpg"); boolean isConvert = ImageUtils.convertFmt(file, flTgt); if(isConvert) { ImageUtils.resizeImage(flTgt.getPath(), 1920, 1080); } ImageUtils.java public class ImageUtils { public static boolean convertFmt(File flSrc, File flTgt) throws Exception { boolean result = false; boolean isConver..
2020.11.26