java中写action时的注意点和问题解决

java中写action时的注意点和问题解决

报错问题如下:
ERROR [com.opensymphony.xwork2.interceptor.ParametersInterceptor] - Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting ‘age’ on 'class com.itheima.web.action.UserAction: Error setting expression ‘age’ with value [‘21’, ]
Error setting expression ‘age’ with value [‘21’, ] - [unknown location]

解决方法:首先是要去到配置文件中进行特别是书写错误的排查和包括tomcat的设置问题,点很小但要格外注意。
其次是针对我如上报错问题,在action类中一定要记得进行对象的封装,很容易被忽略的小点,在此提醒。
java中写action时的注意点和问题解决