@NameBinding @Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Documented @Inherited public @interface Controller
Declares a method as a controller. If declared at the type level, it applies to all methods in the type.
A controller method that returns void is required to be annotated with
View
. A controller method can return a view path
as a String
or a Response
. If a controller
returns null
and it is annotated with View
,
then the value of this annotation is used as a default.
Example:
@Controller
public String sayHello() {
return "hello.jsp";
}
View
,
Response
Copyright © 2017 Ivar Grimstad. All rights reserved.