Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequiredStringValidator validation

 
Jeffrey Coleman
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should also mention that I am using Websphere version 7.0
 
Jeffrey Coleman
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic