File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: RequiredStringValidator validation