Вопрос по – NoSuchMethodException в Struts2

1

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Ваш Ответ

1   ответ
1

setBirthDate(String birthDate)

<s:textfield name="birthDate" />

setBirthDate(String string)NoSuchMethodException

public class MyStringToDateConverter extends StrutsTypeConverter {
    public Object convertFromString(Map context, String[] values, Class toClass) {
       //Parse String to get a date object
    }

    public String convertToString(Map context, Object o) {
       // Get the string from object o
    }
 }

@Conversion()

@Conversion()
public class MyAction extends ActionSupport{
    public Date myDate = null;

    @TypeConversion(converter="MyStringToDateConverter") //Fully qualified name so if this class is in mypackage then converter will be "myPackage.MyStringToDateConverter"
    public void setMyDate(Date date) { 
        this.myDate = date;
    }
}

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded JR Galia

Похожие вопросы