|
Play Framework/Scala example source code file (Routes.java)
The Routes.java Play Framework example source code
/*
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package play;
import play.twirl.api.JavaScript;
import play.libs.Scala;
/**
* Helper utilities related to `Router`.
*/
public class Routes {
public final static String ROUTE_VERB = "ROUTE_VERB";
public final static String ROUTE_PATTERN = "ROUTE_PATTERN";
public final static String ROUTE_CONTROLLER = "ROUTE_CONTROLLER";
public final static String ROUTE_ACTION_METHOD = "ROUTE_ACTION_METHOD";
/**
* Generates a JavaScript router.
*/
public static JavaScript javascriptRouter(String name, play.core.Router.JavascriptReverseRoute... routes) {
return javascriptRouter(name, "jQuery.ajax", routes);
}
/**
* Generates a JavaScript router.
*/
public static JavaScript javascriptRouter(String name, String ajaxMethod, play.core.Router.JavascriptReverseRoute... routes) {
return play.api.Routes.javascriptRouter(
name, Scala.Option(ajaxMethod), play.mvc.Http.Context.current().request().host(), Scala.toSeq(routes)
);
}
}
Other Play Framework source code examplesHere is a short list of links related to this Play Framework Routes.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.