stanlick wrote:

Here is the current solution:
<s:form  action="gradeQuiz" namespace="quiz">
<s:submit key="gradeMe" method="score"/>
        


I avoid using the method attribute of submit. The problem is that it includes a special prefix on the submit's paramater that the default action mapper detects, strips and selects that target method of your action. That's fine and quite nice, however, XML validation works on the action name only and doesn't know you're calling a special method, so it may run the wrong validation task or skip validation entirely. My preference is to use wildcards so the action name contains the method name.

<s:form action="gradeQuiz" namespace="quiz">
<s:submit key="gradeMe" action="gradeQuizScore"/>

where the action is defined as
 <action name="grateQuiz*" method="{1}" ...

In this case, the action attribute of the form is completely ignored and each button can point to a different action and method in the namespace.

I don't recall whether AnnotationValidation allows you to run different validation on different methods in the same action (it never used to work). If that works now the problem is avoided.



Anyways, I am still a bit confused as to why the attributes need to be
distributed across the two tags to get this to work correctly.  It seems
like maybe the namespace should be an attribute of the submit tag or else
the action-method an attribute of the form!  The only error I was seeing had
to do with the goofy ParametersInterceptor<sp?> and it had me chasing my
tail far too long!  Far too long!!!

        
I agree it's confusing. I think it goes back to early versions of webwork and that's the way it works. I think the struts2 has moved on but the tags are much the same. When I've needed to use a different namepace for a button I've used javascript to change the action of the form prior to submit.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to