struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: Extending RequestProcessor to handle validation errors
Date Thu, 03 Feb 2005 13:38:50 GMT
Hi Kishore,

I've actually decided to not use this "trick" anyway, based on a point 
raised by Niall.  I'll actually be cloning the ActionMapping and 
changing the input in that clone.  I hope to actually implement this 
today, but I have a huge conference call most of the day, so we'll see.

> This might fail in the case where the Controller's 'inputForward' is
> set to true.

I'm pretty sure my code would overrule that, but it winds up being I 
think amoot point in light of the above planned change.

> I have couple of questions regarding the "jsp" that you want to go to
> incase of a validation error.
> * Is the path to that jsp going to be a constant one or is it going to
> come from a config file

It will come from a config file, or if none is used than it will be a 
default, which at least for the initial pass will be in a known place. 
I will probably have to decree that my webservices-config.xml file, 
which is now optional, is required eventually because that's where a 
setting like the default would be placed.  I'm going through this 
iteratively though, so I don't mind leaving one or two limitations in it 
the first time through.

> * Is the path to the jsp going to be constant no matter what
> web-service you are going to execute (More precisely, does the path
> depend on the ActionMapping)

Same answer as above... as it currently stands, what you do, usually, is 
create a webservices-config.xml file.  This contains all the settings to 
turn a regular mapping into a Web Service.  One of the things you can 
set is what JSP to use for generating the response, and now you can also 
set what JSP to use for validation failures.

> If the answer is NO to the above questions then, there are two
> relatively easy ways.
> 
> 1) Override processValidate() like so
> 
[snip]
> 
> 2) Override "processForwardConfig" and
> "internalModuleRelativeForward". These are the two methods used by
> processValidate() to forward or redirect when an input validation
> happens. Just create a new method which checks whether validation
> passed or not by looking in the request for ActionErrors
> 
> [snip]
> 
> Thoughts?

I'm leaning towards the first approach, but I frankly have to take some 
time to digest what you've written here.  I'm just about to leave for 
work, and I hope to have some time to work on this today, otherwise 
tonight.  Thank you for your suggestions, I'll let you know which way I go.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com





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


Mime
View raw message