struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18085] New: - page not set correctly when an Action's INPUT is set to another action
Date Mon, 17 Mar 2003 23:36:57 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18085>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18085

page not set correctly when an Action's INPUT is set to another action

           Summary: page not set correctly when an Action's INPUT is set to
                    another action
           Product: Struts
           Version: Unknown
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: lquijano@hotpop.com


Suppose I have the following action mappings:

<action path="/page1" name="SomeForm" validate="false" type="..." />

<action path="/page2" name="SomeForm" input="/page1.do" type="..." />

<action path="/page3" name="SomeForm" input="/page2.do" type="..." />

(and page1 goes to page2, then to page3...)

So, this is a multipage form, and the ideal behavior when page2 fails validation
is to return to page1, and if page3 fails it returns to page2. And besides, I
need the INPUT to point to actions instead of JSPs or tiles because those
actions perform some other tasks...

The problem is, AFAIK, that if I submit page3 the ActionForm's page is "3". So,
after it fails validation and goes to page2, the Validator would perform
validation *again*. It'd incorrectly check page3's fields (because, again, the
ActionForm page is 3), and it would cascade back to page1 (with a confusing
error message of page3 fields missing). 

So, the correct behaviour would be one of two:
a) After failing page3 validation, it would set the page to "2". Then, it would
check page2's fields only, and only fail if the session has expired, for
example. This would imply a change in ActionMapping, maybe, adding a "page"
parameter. 
b) After failing page3 validation, it would deactivate validation for page2, and
go straight ahead for the action. Of course the action wouldn't expect this, so
this could be a problem. 

This is a subtle bug, I think... A proposed correction would be (A), to add a
new element in the ActionMapping's XML definition:

<action path="/page1" name="SomeForm" validate="false" page="1" type="..." />

<action path="/page2" name="SomeForm" input="/page1.do" page="2" type="..." />

<action path="/page3" name="SomeForm" input="/page2.do" page="3" type="..." />

Besides that, the ValidatorForm's page property would be removed. Instead, the
Validator would check the current Action's page, and perform the check.

What do you think?

Leonardo

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message