Top Description Methods
jakarta.mvc

public @Interface Controller

extends Annotation
Annotations
@NameBinding
@Target:METHOD, TYPE
@Retention:RUNTIME
@Documented
@Inherited
Imports
jakarta.ws.rs.NameBinding, java.lang.annotation.Documented, .Inherited, .Retention, .Target

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 java.lang.String or a jakarta.ws.rs.core.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";
    }
Authors
Santiago Pericas-Geertsen, Ivar Grimstad
Since
1.0
See Also
View, jakarta.ws.rs.core.Response

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString