Struts2 'Required' field Validation Interceptors not working

后端 未结 1 1592
南笙
南笙 2020-12-21 10:03

Building a login application (In Netbeans 731) which basically ensures non blank values for username and pw. The application runs fine except the validation doesn\'t work, s

1条回答
  •  醉酒成梦
    2020-12-21 10:48

    Required validator is a basic validator type and it checks for null field values. If you enter blank characters to the input fields it may not work. Use requiredstring validator instead.

    
        
            Please enter a user name
        
    
    
        
            Please enter a password
        
    
    

    The action class extends ActionSupport, it has default implementation of the Action interface required to return result after the action execution. And package extends struts-default that has and it inherited to your package.

    Also, the FilterDispatcher is deprecated since Struts 2.1.3.

    0 讨论(0)
提交回复
热议问题