0

大家好,我在使用 struts 验证时遇到问题,如下所示:加载了编辑配置文件页面,当用户单击保存时,如果存在错误,则应执行验证,必须重定向到同一页面,并显示验证错误,并加载数据, 否则调用执行方法。错误列表有值但屏幕上没有显示错误会发生什么情况,我的代码快照是:我正在使用 struts 1

<action path="/selectUserAction" validate="true" input="/selectUserAction.do"       type="com.bg.sharjah.usermanagement.manageusersgroups.web.actions.SelectUserAction" 
        name="editUserProfileFormBean" scope="request">


    @Override
public ActionErrors validate(ActionMapping mapping,
        HttpServletRequest request) {
    //Logger.getAnonymousLogger().log(Level.WARNING,"");
    ActionErrors errors = new ActionErrors();
    try{

    errors = super.validate(mapping, request);
    System.out.println("validate <<<<<<<<<<< "+errors.size());

    }catch(Exception e)
    {
        e.printStackTrace();
    }
    return errors;
//  Validation.match(errors, password, confirmPassword);
    //Validation.match(errors, email, confirmEmail);    

}

注意:我的表单 bean 用于不同的操作,我还需要知道如何使用输入属性重定向到同一页面?

4

1 回答 1

0

谢谢所有我发现问题是资源包问题。

于 2012-02-12T11:11:39.133 回答