On Mon, 24 Jan 2005 13:34:50 +0000, Andy Richards <[EMAIL PROTECTED]> wrote: > Hi > > I have the requirement to perform server side validation on a form, no > probs. The problem is that i have a set of error rules and a set of > warning rules. There is no problem defining the errors in my > validation.xml and returning the user to the page to correct them, > however at some point probably when all error messages have been > validated i need to show warning messages. For example "value X is > outside of the normal range do you want to continue?" If not i want the > user to be able to change their value, however this then means i need to > do the error checking again incase the user has changed there warning > value to an error value!! I thought of the idea of having error rules in > my validation.xml and then dynamically validating the warning rules > progmatically in my action (not sure if this is the best method > though). Has anyone come across a solution or able to think of a better > method of implementing this functionality.
Struts, I believe, has no real mechanism for warnings, so your going to have to put that into the session yourself. I think the better place would be in the validation method of your form. Make sure you call super.validate. Any errors it returns will be errors, then you can check for warnings, putting those messages into your warning attribute. > > Many thanks > > Andy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]