web.xml 에서 아래와 같이 수정한다.
<servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:/spring-servlet.xml</param-value> </init-param> <multipart-config> <max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0</file-size-threshold> </multipart-config> </servlet>
<bean id="multipartResolver" class="org.springframework.web.multipart.support.StandardServletMultipartResolver"> </bean>
//ControllerCollection<Part> parts = req.getParts();
for(Part part : parts) { System.out.println("Name:"); System.out.println(part.getName()); System.out.println("Header: "); for(String headerName : part.getHeaderNames()) { System.out.println(headerName); System.out.println(part.getHeader(headerName)); } System.out.println("Size: "); System.out.println(part.getSize()); part.write(part.getName() + "-down"); }
'소프트웨어 > Spring Framework' 카테고리의 다른 글
@RequestMapping (0) | 2013.08.03 |
---|---|
Content-Type=x-www-form-urlencoded (0) | 2013.08.01 |
[Spring] ref local과 ref bean의 차이점 (0) | 2013.07.29 |
메시지 컨버터의 종류 (0) | 2013.07.18 |
스프링에서 Log4J 대신에 SLF4J를 사용하는 방법 (0) | 2013.06.29 |