Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [krazo-dev] Annotation inheritance

Hi Gregor,

MVC uses the same annotation inheritance rules has JAX-RS, which are a bit "special". :-)

Is the method „brokenView“ in Simple-Controller valid? 

IMO yes, it is valid. The controller class is AnnotatedController and although the actual controller method is declared in the super class, the @View annotation on AnnotatedController should be used. But as I said, just my point of view. I'm sure somebody could find good arguments for interpreting it in some other way. :-)
 
The specs states that controller methods might return null to fall back to a view annotation. Is throwing an exception if no view annotation exists the right thing to do?

Yes, this case cannot be handled by the MVC implementation. So throwing an exception would be the right thing to do. 
 
Does this still apply if the method is inherited in the AnnotatedController? 

As mentioned above: IMO the actually controller class is AnnotatedController and has a @View annotation on the class level. So this @View annotation should be considered in this case.

Christian


--

Back to the top