@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 returns a view as a
String
, as part of a Viewable
or as a
Response
whose entity is a Viewable
.
If a controller method returns void, then the view must be specified using
the View
annotation.
Example:
@Controller
public String sayHello() {
return "hello.jsp";
}
Copyright © 2015 Oracle Corporation. All rights reserved.