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

struts2 :placing actionname-validation.xml file in the classes directory

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am writing a web application using struts 2 and am using the xml validation to validate one of my forms. I am able to validate the form successfully by placing it in the same directory as in my action class. But I need to place the validation xml file in the

directory in my tomcat server.

But when i place it there the validation does not happen.

Do I need any specific configuration to be done?


Thanks in advance
Paddy
 
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
Validation files need to follow the same package hierarchy as the actions they're intended to validate.

Why do you need to place the validation file in a place it won't work?
 
paddy Mahadeva Iyer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In my project we are trying to consolidate all configuration files (by configuration I mean xml and properties files) in the classes directory and lot let them spread across with the class files. I therefore need to put them in a single directory at the root level. Preferably the classes directory,


Thanks
Paddy
 
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
Well, that's not how the action-specific validation file work. I don't know of any trivial workaround. IMO it doesn't make much sense to throw them into a single directory--the idea is to keep related functionality *together*, and since the validation files are tied closely to the action they validate, they're in the "right" spot.

Some build environments (like Maven) would have a separate directory for non-Java files, but even then they'd still be in the required package hierarchy.
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic