![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FUjDMm%2FbtqDbkPiS3Q%2Fy6qYOPfPSBfYt25nJwKp30%2Fimg.png)
흔히 git 을 사용할때 올리고 싶지 않은 파일의 경우 ignore를 사용하여 올리지 않는다 이경우 db의 내용이라던가 중요 내용은 올리면 안되는데 이것을 해결할때 프로퍼티를 사용하면 db프로퍼티 파일은 올리지않고 값을 넣어서 사용가능하다 . 1. 프로퍼티 파일을 만든다 2. 프로퍼티 파일의 내용 3. PropertyPlaceholderConfigurer 클래스를 빈으로 등록하여 사용 하거나 태그를 사용하여 프로퍼티 설정값을 사용한다 3-1) 태그를 사용하는 경우 xml에 추가 하고 이때 두개의 프로퍼티 파일을 사용할경우 콤마를 사용하여 분리하여 사용한다 , 를 여러개 사용하는 경우 첫번째만 인식이 되어 에러가 발생한다 3-2) PropertyPlaceholderConfigurer 클래스를 빈으로 등록하..
트랜잭션 처리 시 어노테이션을 사용하여 쉽게 롤백처리가 가능한데 이때 롤백에 이루어지지 않는 경우가 발생 할 수 있다 이때 root-context.xml 에 아래와 같은 코드를 삽입하고 끝을 내는 경우가 있는데 servlet-context.xml에 부분을 삽입해야 롤백을 할 수 있다. root-context.xml servlet.xml http://bbans.blogspot.com/2014/06/transactional-spring.html @Transactional spring 롤백 트랜잭션 트랜잭션 처리 부분을 만들려고 오전부터 머리를 좀 쎄게 굴려봤다. 알고나면 별 것 아닌 것들이... 할 때는 왜이렇게 사람을 힘들게 하는가...ㅎㅎ 여튼 예전에도 스프링에서 트랜잭션 처리를 해본적은 있었으나... ..
파일 업로드 시 두가지 방법이 존재한다 1. form태그를 이용한 방법 업로드 2. ajax를 이용한 방법 (formData를 이용하여 파일을 전송하는방법 formData는 가상의 form이라고 생각) var data = event.originalEvent.dataTransfer.files; var formData = new FormData(); formData.append("profileImg",data[0]); $.ajax({ url:"${path}/upload/insertProfileImg", processData : false, contentType : false, type:"POST", data:formData, dataType:"text", success:function(result){ con..
ajax를 사용시 type을 post를 이용할 때 controller에서 @requestbody를 사용해서 받을 때 아래와 같은 에러가 발생한다. application / x-www-form-urlencoded를 사용할 때 Spring이 그것을 RequestBody로 이해하지 못한다는 것이다다. 따라서 이것을 사용하려면 @RequestBody 주석을 제거해야합니다 . HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported 클라이언트 $.ajax({ url: "/scheduler/user/usercheck", type: "post", data: usercheck..
자바 1.6 -> 1.8 , Spring 4.1.3 -> 5.1.3 로 업글 시 아래와 같은 에러 발생 1.6 4.1.3.RELEASE 1.6.10 1.6.6 1.8 5.1.3.RELEASE 1.6.10 1.6.6 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: F..