2010-05-03 2 views
0

을 확인 할 수 있습니다 다음 줄에 method 속성을 변경하여 작업에 대한 실행을 위해 사용되는 방법 변경 : 그것뿐만 아니라 사용 된 검증 방법을 변경할 수 있습니다, 또는이다struts2는 Struts2에서

<action name="registerVal" class="cz.vutbr.fit.pishotel.model.action.Register" method="execute"> 

을 메서드 이름을 하드 코드 된 것으로 확인합니다.

답변

0

다음과 같이 하드 코딩됩니다. 당신은 할 경우 다음 입력 registerVal

반환됩니다 fieldErrors 컬렉션에서 오류가 있으면

<action name="registerVal" class="cz.vutbr.fit.pishotel.model.action.Register" method="myMethod"> 

은 그런 검증 인터셉터가

public void validateMyMethod() { 

if (someValue == null) { 

addFieldError("myField","myMessage"); 

} 

} 

를 호출합니다

관련 문제