DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-17 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil





--- Additional Comments From [EMAIL PROTECTED]  2003-09-18 04:26 ---
I began to make everything create ActionMessages. However, with the validator 
hooks provided by struts the ActionErrors class is pretty tightly interwoven. I 
made everything in the ActionValidatorUtil return ActionErrors because i didn't 
want to intermingle ActionErrors and ActionMessages. I can make the change back 
to ActionMessages once all the hooks are provided to seemlessly use 
ActionMessages in the Struts base classes.

For example:
Resources.initValidator only accepts ActionErrors in it's method signature.

I think we need to go through the Struts code and deprecate ActionErrors and 
provide alternate ActionMessages method signatures.

If you want i can lock away some time to do this. Otherwise, I will keep my 
patches using the ActionErrors until the base struts classes deprecate 
ActionErrors and provide ActionMessages hooks.

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-17 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil





--- Additional Comments From [EMAIL PROTECTED]  2003-09-18 04:19 ---
Created an attachment (id=8269)
The base Action class with methods added to take advantage of the ActionValidatorUtil

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-17 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil





--- Additional Comments From [EMAIL PROTECTED]  2003-09-18 04:18 ---
Created an attachment (id=8268)
new patch with requested changes

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil

[EMAIL PROTECTED] changed:

   What|Removed |Added

   Keywords||PatchAvailable

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil





--- Additional Comments From [EMAIL PROTECTED]  2003-09-12 14:02 ---
Action.execute() throws Exception so there's no need to catch ValidatorException 
and turn it into a generic Exception.  The Singleton implementation I've been 
using can be seen in ModuleUtils and TagUtils as well as in Commons Validator.

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil





--- Additional Comments From [EMAIL PROTECTED]  2003-09-12 00:31 ---
1. Why do you catch ValidatorException and create a new Exception with its 
message?

This was to avoid having to have a try catch block in the Action when i used 
it. If we incorporate access to the util into the base Action class i will 
catch it in the Action method that accesses it and/or have the method throw an 
generic Exception.



2. As much code as possible should use ActionMessages instead of ActionErrors. 
ActionErrors is only still around because it's part of ActionForm.validate()'s 
API.

I thought that was the case. But, i was unsure about the direction of the 
Messages API. I can change that.



3. request.getSession().getServletContext() is a Servlet 2.3 feature so we need 
a different way of getting the ServletContext().

Well, if we make access to the util part of the base Action then there would be 
no need to get the context via the request. We could pass the servlet reference 
into the util in order to get at the context.



4. Maybe these methods should go into Action instead of a util class.  Action 
knows about its Servlet which can get you to the ServletContext.

I agree. I wrote the util because i didn't want to create my own build of 
Struts and needed to use it immediately. However, i think instead of including 
the code in the action itself it should remain a util and the action should 
have a method that calls the util to perform validations... much like the 
ActionForm.



5. If we do go with a util class it should be a Singleton with non-static 
methods.  Statics don't allow for subclassing and specialization which someone 
will need (we learned this the hard way).

Absolutely no question about it. I agree. Again, i looked at some of the 
current patterns being used in struts and made the decision toward static based 
on other struts utils. However, i am quite aware of the annoying limitations of 
statics.



I can make the Util extendible as a singelton. Is there a particular 
implementation of the Singleton pattern that the struts dev group is fond of? 
Otherwise, I can provide it as a singleton and see if it meets your criteria.

Also, I will write a patch that integrates use of the util into the base Action 
class.

Does this all sound good?

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-10 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil





--- Additional Comments From [EMAIL PROTECTED]  2003-09-11 03:34 ---
This seems like it would be pretty useful.  A few things:

1.  Why do you catch ValidatorException and create a new Exception with its message?

2.  As much code as possible should use ActionMessages instead of ActionErrors.
 ActionErrors is only still around because it's part of ActionForm.validate()'s API.

3.  request.getSession().getServletContext() is a Servlet 2.3 feature so we need
a different way of getting the ServletContext().

4.  Maybe these methods should go into Action instead of a util class.  Action
knows about its Servlet which can get you to the ServletContext.

5. If we do go with a util class it should be a Singleton with non-static
methods.  Statics don't allow for subclassing and specialization which someone
will need (we learned this the hard way).

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



DO NOT REPLY [Bug 16401] - ActionValidatorUtil

2003-09-01 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=16401

ActionValidatorUtil

[EMAIL PROTECTED] changed:

   What|Removed |Added

URL|http://www.phase.ws/struts/ |
Summary|ValidatorLookupDispatchActio|ActionValidatorUtil
   |n   |



--- Additional Comments From [EMAIL PROTECTED]  2003-09-01 15:34 ---
This utility allows for you to validate forms, beans, or any other javabean 
compliant class from within the Action. You simply pass it a validation key and 
the bean you want to validate. It will create an ActionErrors object for you or 
you can pass in an already existing ActionErrors object. This provides a 
greater amount of reuse with validator configuration because it doesn't have to 
be on the form level. Therefore, you can create more fine-grained validators 
for your beans.

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