Notice
Recent Posts
Recent Comments
Link
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Archives
Today
Total
관리 메뉴

한바다

스프링부트 오류-Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 본문

servlet

스프링부트 오류-Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.

한바다진화 2024. 6. 21. 21:39

☑️ 뛰어쓰기 공란,괄호 누락으로 오류 발생

공란을 없애줘야 한다. 이미지 업로드는 예민함
(/누락됨)
수정됨
} 하나 누락

☑️스프링부트에서 이미지파일 업로드

현실에서는 파일업로드가 딸깍 딸깍 버튼 몇번으로 되지만 컴퓨터 입장에서는 수많은 숫자와 문자들을 해석하는

과정의 결과로 출력되는 결과 이므로 쉽지 않은 일이라고 한다. 이미지 파일이 액박뜨거나 할때 때론 컴퓨터의

입장도 헤아려 봐야겠다

 

이미지를 form태그에 넣어서 업로드를 진행할 때는 enctype를 작성한다.

enctype = 어떤 파일을 전송할 때 데이터 타입이 무엇인지 체크하고

이미지 파일을 post로 업로드 하기 위해서는 mutipart/from-data를 반드시 작성해서 전달하는 것이 안전하다.

또한 en c type sms ENCoding Type이므로 entype으로 오기재 하지 않도록 주의해야 한다.

[이미지 업로드 html예시]

<h1>돼지 사진 업로드</h1>

<form action="/upload" method="post" enctype="multipart/form-data">

<div>

<label >돼지이름:</label>

<input type="text" th:field="${p.pig_name}" required>

<!--다음에 진행할 다른방법 2번 input type="text" name="pig_name" required -->

</div>

 

<div>

<label >돼지나이:</label>

<input type="number" th:field="${p.pig_age}" required>

</div>

<div>

<label >돼지이미지:</label>

<input type="file" th:field="${p.pig_image_path}" required>

</div>

<button>업로드</button>

 

</form>