메서드에는 "String method ()… [etc]…"서명이 있어야하지만 "void method ()"서명이 있어야합니다.
각 행에 버튼이있는 데이터 테이블이 있습니다.
<ice:dataTable ... var="item">
<ice:column>
<h:commandButton value="Download" action="#{mybean.downloadItem(item)}" />
</ice:column>
</ice:dataTable>
backing bean에는 다음 방법이 있습니다.
public void downloadItem(Item item) {
// ...
}
모든 것이 잘 작동하지만 (클릭하면 메서드가 실행 됨) Eclipse 유효성 검사가 다음과 같은 이상한 메시지와 함께 실패합니다.
메소드에는 "문자열 메소드 (), 문자열 메소드 (), 문자열 메소드 (문자열), 문자열 메소드 (문자열, 문자열), 문자열 메소드 (문자열, 문자열), 문자열 메소드 (문자열, 문자열, 문자열, 문자열)이 있어야합니다. , String 메서드 (String, String, String, String, String), String 메서드 (String, String, String, String, String, String), String method (String, String, String, String, String, String, String), String method (String, String, String, String, String, String, String, String), String method (String, String, String, String, String, String, String, String, String), String method (String, String, String, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열), 문자열 메서드 (String, String, String, String, String, String, String, String, String, String, String), String method (String, String, String, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열,String, String), String method (String, String, String, String, String, String, String, String, String, String, String, String, String), String method (String, String, String, String, String, String, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열), 문자열 메서드 (문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열) , String 메서드 (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), String method (String, String, String, String, String, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열), 문자열 메서드 (문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열, 문자열),String method (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String) "이지만 시그니처"void method () "
어떡해?
관련이 있다면 Tomcat 7에서 Eclipse Indigo SR1을 사용하고 있습니다.
무시해. Eclipse는 바보입니다. Window> Preferences> Web> JavaServer Faces Tools> Validation> Type Assignment Problems> Method expression signature incompatibility to Warning or Ignore (기본값은 Error ) 로 설정하여 톤을 지정할 수 있습니다 .
이 블로그 에서 빌린 이미지 는 모두 무료입니다.
The reason is, Eclipse expect the action
attribute to always return String
, not void
. Whilst indeed unspecified in JSF action
attribute, the EL method expressions themselves actually also support void
methods. The overzealous message in turn suggests that the underlying logic responsible for this validation is incapable of determining the individual method arguments and thus it tries to compare the raw method signature against a collection of allowed signatures, which ultimately get shown in the message if no match was found. Based on the message, this problem may also disappear when the method has 20 or more arguments ;)
이 문제는 문제가보고 된 지 거의 6 년 후인 Eclipse Luna SR1에서 수정되었습니다. 심각도가 오류 에서 경고 로 감소했습니다 . 여전히 Ignore로 낮추고 싶을 수 있습니다 .
또한보십시오:
'Program Tip' 카테고리의 다른 글
TypeScript 제네릭에 대해 여러 유형 제약 조건을 지정할 수 있습니까? (0) | 2020.11.21 |
---|---|
Python에서 텍스트 파일의 특정 줄 편집 (0) | 2020.11.20 |
Ruby Activerecord IN 절 (0) | 2020.11.20 |
std :: string에 null 종결자가 포함되어 있습니까? (0) | 2020.11.20 |
Genymotion이 Android 가상 장치를 시작하지 않습니다. (0) | 2020.11.20 |