• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 1.3.10 custom validations

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm upgrading from old version of Struts to 1.3.10 and I have a problem regarding validator-rules.xml.

In Struts 1.3.10 validator-rules.xml it says:

"This file contains the default Struts Validator pluggable validator
definitions. It is contained in struts-core.jar, and should be
referenced in the struts-config.xml under the plug-in element
for the ValidatorPlugIn.

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/org/apache/struts/validator/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>"

However I have a lot of custom validators made in this file from previous version, where the file was located in /WEB-INF/validator-rules.xml.

My question is: Where should these custom validators be located in 1.3.10, I assume I should not edit the struts-core.jar for this.
 
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
Welcome to the JavaRanch. If you can at all help it, Don't use Struts 1. The last release of Struts 1.3 was in 2008, so even if you update to the latest version, it's already 8 years old.
That said, the documentation for Struts 1.3 says:

By convention, the validators your application uses can be loaded through a file named "validator-rules.xml", and the validator forms (or "validations") can be configured separately (say, in a "validations.xml" file). This approach separates the validators, that you might reuse in another application, from the validations that are specific to each application.


So I would assume you would not edit the core JAR, but you would place your configuration in /WEB-INF/validator-rules.xml
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic