多语言展示
当前在线:1691今日阅读:155今日分享:35

Java中 Cannot retrieve definition 错误解决

在写Java过程中,遇到Cannot retrieve definition for form bean null on action错误的解决方法
方法/步骤
1

jsp文件:< ml:form>

3

Java文件:public class LogoutAction extends Action { @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {   HttpSession session = request.getSession(true);  session.removeAttribute('username');  return mapping.findForward('login'); }}

4

改成:< ml:form>还不行还是出现 Cannot retrieve definition for form bean null on action /admin/exit.do这个错误。

5

如果要用到html:form标签则在strtus-config.xml中必须为其创建form-beans成功显示,换成就行了困扰了大半天,在群里也是没人能明白,到网上查了错误才了解到如果jsp页面中要用到标签的 话务必得创建它的form-bean,否则就会提示Cannot retrieve mapping for action这个错误。

推荐信息