• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Struts2 Validation problem

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi iam new to struts2 . iam using Xx-validation.xml while validating the fields are getting validated
but each time a new a message is added for the same field
for example name
message : Enter your name
when i submit the page without giving any value in the name field
this time i will get two error messages
Enter your name
Enter your name

can any please help me
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Praveen,
Welcome to the Ranch.

We have a dedicated forum for Struts. I will move this thread there for you.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using Spring? If so, your actions should be "prototype" scope--actions are expected to be created per-request.
 
praveen moturi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

praveen moturi wrote:hi iam new to struts2 . iam using Xx-validation.xml while validating the fields are getting validated
but each time a new a message is added for the same field
for example name
message : Enter your name
when i submit the page without giving any value in the name field
this time i will get two error messages
Enter your name
Enter your name

can any please help me




i am using struts2.x with hibernate


my problem is that in the jsp when i submit again without entering any thing in required field this time two messages
will be displayed like "field require" "field required"
for the third time "field require" "field required" "field required"
validation is working instead of one message the messages are getting piled up
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My original question remains unanswered.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David, this is exactly the problem I was having as well, and yes, *I* am using Spring. I set the bean to use 'scope="prototype" ' and it worked perfectly.

Thanks a bunch.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At least it helped *somebody* ;)
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic