MultipartRequest 를 통해서 파일 업로드 한것을 받을 때는발생하지 않던 Error 가 발생했다.
내용은 다음과 같다.
'어떤 multi-part 설정도 제공되지 않았기 때문에, part들을 처리할 수 없습니다.'
정학한 원인은 파악하지 못했지만 구글형님에게물어보니 몇가지 해결 방법들이 있었다.
1. library 추가
pom.xml
<!-- fileUpload library -->
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.5</version>
</dependency>
2. bean 생성
servlet.xml
<beans:bean id="multipartResolver" class="org.springframework.web.multipart.support.StandardServletMultipartResolver">
</beans:bean>
3. tomcat context 설정
<Context allowCasualMultipartParsing="true" path="/" reloadable="true">
<Resources cachingAllowed="true" cacheMaxSize="100000" />
</Context>
다음과 같은 설정을하니 정상적으로 생성이 되었다.
'dev > JAVA' 카테고리의 다른 글
[JAVA] 제네릭스 (0) | 2022.06.02 |
---|---|
[JAVA] 익명 클래스 (0) | 2022.05.31 |
[JAVA] 인터페이스의 장점 (0) | 2022.05.31 |
[JAVA] 인터페이스의 다형성 (0) | 2022.05.31 |
[JAVA] 인터페이스 (0) | 2022.05.31 |