본문 바로가기

개발30

[JQUERY/JSTL] SELECT BOX 년도 생성 JQuery와 JSTL로 select box에 년도를 생성해보자! 1. JQuery - HTML JQUERY 년도 - SCRIPT $(document).ready(function(){ setDateSelectBox(); }); function setDateSelectBox(){ var now = new Date(); var now_year = now.getFullYear(); $("#year").append("선택"); // 2005년 부터 올해까지 for(var i = now_year; i >= 2005; i--){ $("#year").append(""+ i + " 년" +""); } } - 결과 2. JSTL JSTL 년도 선택 ${startYear-year} - 결과 2022. 3. 3.
[JAVA] Enumeration 세션값 출력 Enumeration을 사용해 세션에 등록한 모든 값을 출력 Enumeration attributes = request.getSession().getAttributeNames(); while (attributes.hasMoreElements()) { String attribute = (String) attributes.nextElement(); System.err.println(attribute+" : "+request.getSession().getAttribute(attribute)); } 2022. 2. 25.
[JAVA] String 문자열 따옴표(") 넣기 자바에서 문자열에 " "를 사용하기 때문에 따옴표를 그냥 넣으면 아래와 같이 오류가 보인다! 그래서 따옴표를 넣을때 \" 넣으면 된다. - TEST String test = "A: \"안녕하세요!\"... B: \"안녕!\""; System.out.println(test); - 결과 2022. 2. 22.
[JAVASCRIPT] 첨부파일 이미지 미리보기 (input type="file") 간단하게 첨부파일 이미지를 미기보기 할 수 있다! - HTML - SCRIPT function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { document.getElementById('preview').src = e.target.result; }; reader.readAsDataURL(input.files[0]); } else { document.getElementById('preview').src = ""; } } - 결과 2022. 2. 22.
[SPRING SECURITY] BCryptPasswordEncoder 비밀번호 암호화 테스트 환경: 전자정부프레임워크 3.7 / SPRING 4.2.4 1. pom.xml 에 spring security dependency 추가 org.springframework.security spring-security-web 4.2.3.RELEASE org.springframework.security spring-security-core 4.2.3.RELEASE org.springframework.security spring-security-config 4.2.3.RELEASE 2. 암호화를 위해 context.xml 에 bean 객체 생성 3. @Autowired BCryptPasswordEncoder @Autowired BCryptPasswordEncoder passwordEncoder; 4. .. 2022. 2. 4.
반응형