Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Struts2 validation

 
Bilal A. Siddiqui
Ranch Hand
Posts: 53
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure how to help without any code, configuration, or anything.
 
Bilal A. Siddiqui
Ranch Hand
Posts: 53
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 53
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I rectified the problem myself.

Thanks to all.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic