public class UpdateGoodAction extends AbsAction implements ModelDriven<UpdateGoodRequest>{
private UpdateGoodRequest request=new UpdateGoodRequest();
private UpdateGoodResponse response;
@Override
public String execute() throws Exception {
response=DataFactory.getInstnce().getDataProvider().getResponse(request);
if(response!=null)
return SUCCESS;
else
return ERROR;
}
public UpdateGoodRequest getRequest() {
return request;
}
public void setRequest(UpdateGoodRequest request) {
this.request = request;
}
public UpdateGoodResponse getResponse() {
return response;
}
public void setResponse(UpdateGoodResponse response) {
this.response = response;
}
public UpdateGoodRequest getModel() {
return request;
}
}
public class UpdateGoodRequest extends AbsRequest{
private Good good;
public Good getGood() {
return good;
}
public void setGood(Good good) {
this.good = good;
}
}
报错为:
Unexpected Exception caught setting 'city' on 'class com.fy.action.UpdateGoodAction: Error setting expression 'city' with value ['北京', ]
Error setting expression 'city' with value ['北京', ] - [unknown location]
at com.opensymphony.xwork2.ognl.OgnlValueStack.handleRuntimeException(OgnlValueStack.java:197)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:174)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:148)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:318)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:231)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)