my dog learned polymorphism*
The moose likes Struts and the fly likes RequiredStringValidator validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "RequiredStringValidator validation" Watch "RequiredStringValidator validation" New topic
Author

RequiredStringValidator validation

Jeffrey Coleman
Greenhorn

Joined: May 25, 2012
Posts: 23
I have an issue with the struts 2 RequiredStringValidator validation annotation making a method not exectue even though the specified fieldname has been entered on the form. The annotated method is get_user() in RecordAction line 284.


This is my action class RecordAction.



my struts.xml is



my web.xml



and my jsp



Any help would be appreciated. Thanks
Jeffrey Coleman
Greenhorn

Joined: May 25, 2012
Posts: 23
I should also mention that I am using Websphere version 7.0
Jeffrey Coleman
Greenhorn

Joined: May 25, 2012
Posts: 23
I made a correction.

The RequiredStringValidator annotaion was using the wrong field. This is currently the annotation used.

@Validations(
requiredStrings =
{
@RequiredStringValidator(type=ValidatorType.SIMPLE,fieldName="user_pin", message="You must ener a PIN")
})

The problem is that it always sees the field as empty
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequiredStringValidator validation