struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <d...@newfield.org>
Subject Re: dynamic return when validation failed
Date Wed, 08 Jul 2009 18:23:37 GMT
Greg Lindholm wrote:
 > Not sure why you think I don't understand referer.

I already quoted the bits that illustrate this perceived 
misunderstanding, but since you apparently want me to be more specific:

>> Greg Lindholm wrote:
>>> The referer header will contain the URL of the last request

It won't contain the url of the last request.  The last request 
(chronologically, since you don't specify any other binding for 'last') 
was likely an image or style sheet or something to fill in something on 
the previously rendered page, or even something in another tab.

>>> which will be the action URL not the jsp page that rendered the
>>> result.

This is completely dependent upon how you handle posts.  If you use the 
post-redirect style, it won't be the "action url" (I'm not sure what you 
mean by that phrase, but I assume you're differentiating those urls from 
ones that are not side-effecting), but the GET url that resulted in the 
display of the form.  Assuming post-redirect-only-if-successful, then 
it'll be the url of the step before this one: 
"submit-multi-page-form-step-2" when the step that's failing validation 
is "submit-multi-page-form-step-3" (or "submit-multi-page-form-3" if 
this step failed validation again, which illustrates where this path 
will break down).

>>> So this  wouldn't help the OP if I understood his problem.

The problem is that the OP doesn't understand his problem.  If the 
validation step knows what the result page should be, he shouldn't be 
returning "input", but rather the name of the logical step to be 
rendered.  He's right that the code shouldn't need to know what jsp page 
renders that step, just the logical name of the page, fleshed out in the 
.xml file.

-Dale

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


Mime
View raw message