• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Struts2 validation.xml is not working

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IN my project validation.xml is not working. I am using maven structure and I am new to it. I am using the dependency as struts2 with versionID 2.2.3.1. when I submit the form without entering any data the control is transferred to the result page not the error page. but in the action class I can access all the data from the jsp even though it's null.
The jar files are placed exactly with in the web-inf/lib folder. In web-inf/lib folder i have
commons-io 2.0.1
commons-fileupload-1.2.2
commmons-lang-2.5
freemarker-2.3.16
javassist-3.12.1.GA
ognl-3.0.1
strtus2-core-2.2.3.1
xwork-core-2.2.3.1




My pom.xml


My xxx-validation.xml
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pradeesh Pakkat wrote:The jar files are placed exactly with in the web-inf/lib folder.



"WEB-INF/lib", correct? Case is important.
It looks like there was a problem with JBoss and versions of Struts prior to 2.2.3 see here. You should probably be using the latest version of Struts, 2.3.16. There have been many bug fixes since the 2.2.x days.
Note that the error you posted is at the "WARN" level, so it shouldn't actually impact the application.
Do you have an "input" parameter for your action in struts.xml?
 
Pradeesh Pakkat
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe Ess...

sorry "WEB-INF/lib" is the correct path and I misspelled it. I put those warning message here because I couldn't trace any other issues in the console during validation. And in my struts.xml there is an "input" parameter. There is no error message. From action page it is working normally except the validation.

My struts.xml
 
Pradeesh Pakkat
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to use struts 2.3.16.3 but the effect was same as earlier.

Joe Ess
It looks like there was a problem with JBoss and versions of Struts prior to 2.2.3 see here.


I think that link is saying about an older version of JBoss. I am using JBoss 7.1 but the bug is there itself. :-( .
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pradeesh Pakkat wrote:
I think that link is saying about an older version of JBoss. I am using JBoss 7.1 but the bug is there itself. :-( .



Again, this is a warning, not a bug, so I would not worry about it.

Pradeesh Pakkat wrote:xxx-validation.xml



If you actually named your validation file this, validation will not work. The rules for naming a validation rule file are here.
 
Pradeesh Pakkat
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the point. I put those action file and xml file under 'main/java/action' package. when I split them and put the xml file under resources the problem solved.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic