@Retention(value=RUNTIME) @Target(value=METHOD) public @interface DefaultAction
This annotation specifies the default action for a controller. There can be
only one method with this annotation in a controller. A method annotated with
this annotation must be public. Generally, a default action behaves like an
@Action method, in that it must return a View, and can accept web
parameters. (See Action
for more information.) However, it is invoked
only if no action variable is specified in the request.
As an example, consider the following controller:
@StatelessController("test") public class SomeController { @DefaultAction public View defaultAction() { return new JSP("test"); } }
We can invoke the default action above by making the following request:
http://.../test
Note that we cannot invoke the default action method by appending "/defaultAction" to the path above.
Copyright © 2011-2012 MojaveMVC.org