struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Cupit (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-2587) @SkipValidation not found on superclass method
Date Thu, 10 Apr 2008 20:11:06 GMT

     [ https://issues.apache.org/struts/browse/WW-2587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Brad Cupit updated WW-2587:
---------------------------

    Description: 
The SkipValidation annotation is a great addition, but it would be nice if it was found on
super class methods (i.e. the method being overridden) and/or interfaces.

I have a CGLIB-generated proxy for my Action (created by Spring) so the SkipValidation annotation
is never found, since CGLIB-proxies extend the class they proxy.

Admittedly, this is more of a problem with CGLIB, than with Struts2, however if @SkipValidation
were allowed on methods in interfaces or superclasses, my problem would be solved.

Unfortunately, the validation annotations (like @RequiredStringValidator), _are_ found on
super classes. So the net effect is that my SkipValidation annotation is not found, but the
validation annotations are, which means validation is occurring when it shouldn't.

Workaround:
use one action per url and then only always validate

Fix:
Ideally, the AnnotationValidationInterceptor#doIntercept(ActionInvocation) method would check
for the SkipValidation annotation on the method being overridden. This would not only fix
the CGLIB-proxy issue, but would also allow SkipValidation to be used on interfaces and superclasses.

  was:
The SkipValidation annotation is a great addition, and it worked well for me, until I used
Spring to create CGLIB proxies for my Actions. CGLIB creates a class which extends my Action
class, and the SkipValidation annotation isn't found on the CGLIB-generated proxy.

Admittedly, this is more of a problem with CGLIB, than with Struts2, however if @SkipValidation
were allowed on methods in interfaces or superclasses, my problem would be solved.

Unfortunately, the validation annotations (like @RequiredStringValidator), are found on super
classes. So the net effect is that my SkipValidation annotation is not found, but the validation
annotations are, so validation is occurring on GETs instead of just the POSTs (note: I have
an Action with two entry points: a show() method and a submit() method and show() has @SkipValidation).

Workaround:
use one action per url and then only always validate

Ideally, the AnnotationValidationInterceptor#doIntercept(ActionInvocation) method would check
for the SkipValidation annotation on the method being overridden. This would not only fix
the CGLIB-proxy issue, but would also allow SkipValidation to be used on interfaces and superclasses.


> @SkipValidation not found on superclass method
> ----------------------------------------------
>
>                 Key: WW-2587
>                 URL: https://issues.apache.org/struts/browse/WW-2587
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>            Reporter: Brad Cupit
>
> The SkipValidation annotation is a great addition, but it would be nice if it was found
on super class methods (i.e. the method being overridden) and/or interfaces.
> I have a CGLIB-generated proxy for my Action (created by Spring) so the SkipValidation
annotation is never found, since CGLIB-proxies extend the class they proxy.
> Admittedly, this is more of a problem with CGLIB, than with Struts2, however if @SkipValidation
were allowed on methods in interfaces or superclasses, my problem would be solved.
> Unfortunately, the validation annotations (like @RequiredStringValidator), _are_ found
on super classes. So the net effect is that my SkipValidation annotation is not found, but
the validation annotations are, which means validation is occurring when it shouldn't.
> Workaround:
> use one action per url and then only always validate
> Fix:
> Ideally, the AnnotationValidationInterceptor#doIntercept(ActionInvocation) method would
check for the SkipValidation annotation on the method being overridden. This would not only
fix the CGLIB-proxy issue, but would also allow SkipValidation to be used on interfaces and
superclasses.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message