This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem with Struts2 validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with Struts2 validation" Watch "Problem with Struts2 validation" New topic
Author

Problem with Struts2 validation

Bilal A. Siddiqui
Ranch Hand

Joined: Sep 14, 2008
Posts: 53

Hello All,

I have a registration page known as student registration.

there are few autocompleter fields like country dropdown, state drop down etc.

I am using struts2 validator to validate that none of the fields should be blank. If any field is blank it comes back to same page and displays the message in red that the particular field is required.

now the problem is when it comes back on same page incase of blank field the dropdowns are not working. Autocompleter is not generating the list.


Cheers!!! Bilal
Handsome Android||@bilal_speed||LinkedIn
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not sure how to help without any code, configuration, or anything.
Bilal A. Siddiqui
Ranch Hand

Joined: Sep 14, 2008
Posts: 53


Registration page




My validate xml looks like



and action xml is



The validation is working fine. If it finds any blank field it goes back to registration page and displays the message. But this time autocompleter does not populate.
Bilal A. Siddiqui
Ranch Hand

Joined: Sep 14, 2008
Posts: 53

Hello All,

I rectified the problem myself.

Thanks to all.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's nice to include the solution so that when future searchers have a similar problem they're able to also see some solutions.

A couple of notes:

- Why do you use the "apt" prefix for the S2 tags?
- Why don't you use the framework's default result names (lower case)?

Using non-conventional/non-default naming conventions is fine, of course, but make the code more difficult for new developers to deal with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Struts2 validation
 
Similar Threads
Struts2 autocompleter label and required fields have no effect
Strust2 validation problem
Autocompleter - NoSuchMethodException
struts2 Autocompleter on event
struts2-jquery autocompleter styling