Package play.mvc
Class Router
java.lang.Object
play.mvc.Router
The router matches HTTP requests to action invocations
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Routerstatic longTimestamp the routes file was last loaded at. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactionToUrl(String action, Map<String, Object> actionArgs, Http.Request request, Http.Response response) static voidAdd a new route.static voidstatic voidIn PROD mode and if the routes are already loaded, this does nothing.static StringDeprecated.static StringgetBaseUrl(Http.Request request) static Stringstatic StringgetFullUrl(String action) Deprecated.static StringgetFullUrl(String action, String baseUrl) static StringgetFullUrl(String action, Map<String, Object> args) Deprecated.static Stringstatic StringgetFullUrl(String action, Map<String, Object> args, Http.Request request) static StringgetFullUrl(String action, Http.Request request) matchRoute(String method, String path) static StringDeprecated.static Router.ActionDefinitionDeprecated.static Router.ActionDefinitionDeprecated.static Router.ActionDefinitionstatic Router.ActionDefinitionreverse(String action, Map<String, Object> args, Http.Request request, Http.Response response) static StringreverseWithCheck(String name, File file, boolean absolute) voidrouteOnlyStatic(Http.Request request) static List<Router.Route>routes()voidsetRoutes(List<Router.Route> routes) Replace routes with provided route definitions.
-
Field Details
-
instance
-
lastLoading
public static long lastLoadingTimestamp the routes file was last loaded at.
-
-
Constructor Details
-
Router
-
-
Method Details
-
routes
-
setRoutes
Replace routes with provided route definitions. -
clearForTests
public static void clearForTests() -
addRoute
Add a new route. Will be first in the route list- Parameters:
method- The method of the route * @param action : The associated actionpath- The path of the routeaction- The associated action
-
detectChanges
public static void detectChanges()In PROD mode and if the routes are already loaded, this does nothing.In DEV mode, this checks each routes file's "last modified" time to see if the routes need updated.
-
routeOnlyStatic
- Throws:
RenderStatic- or NotFound
-
matchRoute
-
reverse
Deprecated. -
getFullUrl
Deprecated. -
getFullUrl
-
getFullUrl
-
getBaseUrl
Deprecated.Gets baseUrl from current request or application.baseUrl in application.conf -
getBaseUrl
-
getConfiguredBaseUrl
-
getFullUrl
Deprecated. -
getFullUrl
-
getFullUrl
-
reverse
Deprecated. -
reverseWithCheck
-
reverse
@Deprecated @Nonnull public static Router.ActionDefinition reverse(@Nonnull String action, @Nullable Map<String, Object> args) Deprecated. -
reverse
@Nonnull public static Router.ActionDefinition reverse(@Nonnull String action, @Nullable Map<String, Object> args, @Nullable Http.Request request, @Nullable Http.Response response) -
reverse
-
actionToUrl
@Nonnull public Router.ActionDefinition actionToUrl(@Nonnull String action, @Nullable Map<String, Object> actionArgs, @Nullable Http.Request request, @Nullable Http.Response response) -
actionToUrl
-