웹개발(23)
-
SVN: '0x0040010b: Obtain Project Name' 오류 시
SVN: '0x0040010b: Obtain Project Name' operation finished with error: Unable to make field private java.lang.Throwable java.lang.Throwable.cause accessible: module java.base does not "opens java.lang" to unnamed module 위와같이 에러나 나면서 체크아웃이 안될때 Use '.project' project name for the working copy instead of repository folder name 를 체크 해제 해주고 체크아웃을 진행하면 된다.
2023.07.12 -
JAVA Enum Value로 Key 찾아오기
public enum GubunCode { GUBUN1("GUBUN1_value11", "GUBUN1_value12", "GUBUN1_value13"), GUBUN2("GUBUN1_value21", "GUBUN1_value22", "GUBUN1_value23"); private final String displayValue1; private final String displayValue2; private final String displayValue3; private GubunCode(String displayValue1, String displayValue2, String displayValue3){ this.displayValue1 = displayValue1; this.displayValue2 = ..
2023.07.06 -
Spring Boot Controller 에서 전체 파라메터 폼 클래스 유효성 검증
컨트롤러에 WebDataBinder을 이용하여 파라메터로 넘어오는 폼 클래스의 유효성검증을 추가 private final BoradFormValidator boardFormValidator; @InitBinder("boardForm") public void initBinder(WebDataBinder webDataBinder) { webDataBinder.addValidators(boardFormValidator); } 해당 컨트롤러 상단에 선언을 해줍니다. @InitBinder("boardForm") 에서 boardForm의 이름으로 클래스를 찾아서 검증 @GetMapping("/boardDetail") public String detail(Model model, BoardForm boardForm) ..
2023.07.05 -
Spring Boot Validated 유효성 검증 그룹 설정
public class ValidationGroups { public interface OnUpdate {} public interface OnInsert {} } ValidationGroups 클래스에 해당 interface를 선언 해두고 @Data public class BoardForm { @NotBlank(message = "제목은 필수입니다.", groups = {ValidationGroups.OnInsert.class}) @Length(min = 5, message = "제목은 6글자 이상", groups = {ValidationGroups.OnInsert.class}) @Length(max = 15, message = "제목은 15글자 이하", groups = {ValidationGroups..
2023.07.04 -
Spring Boot 정적 리소스 설정
spring: web: resources: static-locations: classpath:/js, classpath:/css, classpath:/static application.yml에 다음과 같이 경로들을 나열하면 해당프로젝트의 폴더 위치로 접근이 가능하다.
2023.07.04 -
좌표 기반 폴리곤 안에 위치해 있는지 확인하는 자바스크립트
function pointInPolygon(point, polygon) { var x = point[0], y = point[1]; var inside = false; for (var i = 0, j = polygon.length - 1; i y) != (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi); if (intersect) inside = !inside; } return inside; } var po..
2023.07.03