Struts2

struts.properties , 사용방법

gilnet 2010. 8. 16. 18:14
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