This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
jQuery in Action, 2nd edition
 
subject: RequiredStringValidator validation
 
Similar Threads
Yui Autocomplete, No response being returned
Struts 2 Validator Question
problem in printing the values
Passing values to same page
Struts 2 action always returning success