struts.properties
제한 없이 무한업로드 가능
struts.multipart.maxSize=-1
인터셉터에서 용량제한
<interceptor-ref name="fileUpload">
<param name="maximumSize">10240</param>
</interceptor-ref>
ex) properties가 2메가 인터셉터가 1메가인 상황에서 2메가를 넘는 에러가 발생할경우. 인터셉터 에러 메세지로 제어 안되는 상황이 발생한다는..
#업로드된 파일 객체가 NULL인 경우
struts.messages.error.uploading=Error uploading_EN: {0}
#최대 크기가 넘어가는 경우
struts.messages.error.file.too.large=File too large_EN: {0} "{1}" {2}
#ContentType이 허가되지 않은 것인 경우
struts.messages.error.content.type.not.allowed=Content-Type not allowed_EN: {0} "{1}" {2}
용량제어 방법은 크게 3가지 방법이 있다.
-struts.xml
-struts.properties
-interceptor
'Struts2' 카테고리의 다른 글
<s:select>태그 사용 (0) | 2010.08.27 |
---|---|
Struts2에서 예외처리 (0) | 2010.08.26 |
현재 URL 가져오기 (0) | 2010.08.14 |
Struts2 @Results 에서 params이용 방법 (0) | 2010.08.12 |
Validator 날짜 체크 Action (0) | 2010.08.11 |