Hi guys, This is one of those common questions that I just forget the answer to. If you use the INPUT tag in an action mapping, you give struts a JSP page or another action to return control to when form validation errors are found. Now what do you do when you have a couple different JSP pages, or forms I geuss, that can submit to the same action mapping? Is this just one of those things you shouldn't do? Like we all should be using tiles or something so that our page links are generic?
Are these unrelated pages or are they related, as in a wizard? In Struts 1.1 an Exception will be thrown if you try to change the input of a mapping once it has been configured. Prior to 1.1 you could change it programmatically via setInput(). I don't know if there's another approach but my workaround is to bypass the call to validate() at the framework level by setting validate=false in struts config, then invoke the form's validate() in the Action's execute() method. If I get errors back, save them and since I know which page I'm currently on, just forward to that page.
Junliu, You kinda hit the nail on the head. In my example, or at least what I am thinking about, is you have two totaly unrelated business pages. Meaning that while the relate to the same data interaction, they are entered for different reasons. A good example is a "pipeline" page, I have one for open and one for closed. They access the same data, but they present a different dataset with different columns and needs. So I usally use a single action to recieve requests, usally basic stuff that is done on either page. So this is where you get into the issue. I guess it seems like the rule is, if you have more than one page using the same action, you can't validate much at the form level, but in the action you can do whatever you want.