因为你在出现问题之后没有把request中的值,清空!在你的action的execute方法中,加上:。。
//从request范围内把actionMapping的相关内容清空。
httpServletRequest.removeAttribute(actionMapping.getAttribute());
//如果你的form是session范围内有效的,则再加上下边的:
httpServletRequest.getHttpSession.removeAttributeactionMapping.getAttribute());
return actionMapping.findForward(forward);//返回到指定的页面
这样就可以了!一般情况下,如果是提交失败,则不清空,以方便用户直接在原来的基础上改。如果提交成功,则清空,出现一个新的添加页面。
//从request范围内把actionMapping的相关内容清空。
httpServletRequest.removeAttribute(actionMapping.getAttribute());
//如果你的form是session范围内有效的,则再加上下边的:
httpServletRequest.getHttpSession.removeAttributeactionMapping.getAttribute());
return actionMapping.findForward(forward);//返回到指定的页面
这样就可以了!一般情况下,如果是提交失败,则不清空,以方便用户直接在原来的基础上改。如果提交成功,则清空,出现一个新的添加页面。
开始赋初值就置空。
<html:text property />这个标签主要输出formbean中的对应元素,如果是java对像需要保证这个对象中含有正确的tostring方法
问一下<html:text property="model">中的property能不能包括子类啊。
具体如下:http://community.csdn.net/Expert/TopicView1.asp?id=4490361
还有,检查一下你的action和actionform在config文件里,是否是对应关系