2010-08-18 6 views
1

설치 : ICEfaces 1.8.2, Java EE 5, JSF 1.2. PDF 파일을 업로드하는 사용자를 허용하는 입력 _ 태그 및 얼음 :ICEfaces ice : inputFile 파일 이름 유효성 검사 오류에 대한 메시지를 어떻게 설정합니까?

나는 얼음을 사용하고 사용자가 업로드하려고하면

<ice:inputFile fileNamePattern=".+\.pdf" uniqueFolder="false" uploadDirectory="#{FileController.fileUploadDirectory}" uploadDirectoryAbsolute="true" actionListener="#{FileController.uploadActionListener}" submitOnUpload="preAndPostUpload" /> 
<!-- ... --> 
<ice:messages /> 

: 메시지 태그는 사용자에게 오류 피드백을 제공 이름이 '.PDF'로 끝나지 않는 파일은 얼음 : 메시지 태그는 다음 (비밀 및 사용자 적대적) 오류를 보여줍니다

The file name 'halp_im_not_a_pdf.rtf' does not match with the file name pattern '.+\.pdf'

가 어떻게 더 나은 뭔가 메시지를 대체 할 ? 나는 웹 검색 및 'converterMessage'라는 속성을 ice에서 설정하려고 시도했다 : inputFile, 그러나 그들은 일반적으로하는 것처럼 작동하지 않았다.

감사합니다.

+1

업로드 작업시 bean & set 메시지에 따라 validate를 사용할 수 있습니다. 이 링크는 유용 할 수 있습니다 - http://facestutorials.icefaces.org/tutorial/validators-tutorial.html –

답변

1

당신은 등록 정보 파일을 만들 필요가 http://www.icefaces.org/JForum/posts/list/9528.page#39677
를 참조하고, 그 안에 정의 :

com.icesoft.faces.component.inputfile.INVALID_NAME_PATTERN=The file name \''{0}\'' does not match with the file name pattern \''{1}\'' 

가 교체 할 수있는 다른 오류 메시지에 대한 ICEFaces에 messages.properties를 참조하십시오.