Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Struts2 validation problem

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me thanks in advance
hi iam using struts2 validation.xml for validating the form some times the action is directly submitted witout validating

the validation is not working.this is the code in struts.xml

<action name="AddRegistration" method="addAcceptRegistrationForm"
<interceptor-ref name="defaultStack">

<result name="input" type="redirect">/Resources/registration/addRegistrationForm.jsp</result>
<result name="error">/Resources/registration/Error.jsp</result>

and one more problem which i already posted earlier was the old errors are not getting cleared instead it adds up iam not using springs is there any suggestion what the changes i need to make or where can i remove the old errors
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off, the input page should not be a redirect. If you're not using Spring (singular) I don't see how errors could accumulate, since an instance is created per-request--you're going to need to supply more information. When you do, please make sure you UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.
praveen moturi
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for reply

what additionaly information is needed sorry i cant understand iam extending action support class for my action class
and validation.xml in which iam validating my form fields

there are some select boxes in which required vlidation is not working but iam trying other way as min length validation for that

my code is as follows


<field name="registrationFormBean.nationalityId">
<field-validator type="int">

<param name="Min">1</param>
<message> Nationality Is Required </message>

jsp code follows

<s:select name="registrationFormBean.nationalityId"
label="Ntionality" />

the field nationlityId in the bean is of type int

even though i try to validate the field with required it is not validating thats why iam using min length validator instead of required

on more important thing is old errors are not clearing up in the jsp ,the message are adding up

can any please explian to solve the issue i might i have missing some thing is there any additional information i need to post for more clarity

Crusading Chameleon likes the size of this ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic