In struts2, I want to validate address 1 input value on 4 different pages. I dont want to copy the regex in 4 different action_name-validation.xml. Can I create a global validation.xml where I can define a variable and is use it in other action_name-validation.xml files? Please provide an example.
Welcome to the JavaRanch.
The best solution would be to create your own validator and use it in your XML files where necessary. Here is a tutorial but I've never done this myself, so I can't speak to how good the tutorial is.
Personally, when I have to do anything more complex than a make sure a required field is filled in, I use the Validateable interface (built in to ActionSupport) and do the validation programmatically.