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
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.
<field name="userName">
<field-validator type="requiredstring">
<message>Please enter a user name</message>
</field-validator>
</field>
<field name="password">
<field-validator type="requiredstring">
<message>Please enter a password</message>
</field-validator>
</field>
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 <default-interceptor-ref name="defaultStack"/>
and it inherited to your package.
Also, the FilterDispatcher is deprecated since Struts 2.1.3.