Please forgive me; I am sort of new to struts. I am having an issue where my validation is occurring when the page loads instead of when i actually submit my form. I have been
As nmc said, validation fires for the action, and that is what is causing the validation to occur. However, you can still do this without splitting it into two different actions.
First, you could fix this by getting rid of the init method, and just using input - so your initial url would be inputTest instead of initTest. The validation interceptor by default does not fire on the input method. This is how it is usually handled, and how I lay out all of my actions.
If you are set on using init, you can actually specify to the validation interceptor which methods to exclude from validation. You could change your xml to look like this:
init,input
jsp/index.jsp
jsp/index.jsp
jsp/results.jsp
Using this xml simply tells the validation interceptor to not fire for the init or input methods.
Just a couple of different solutions to keep you using just one action class.