|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectplay.GlobalSettings
public class GlobalSettings
GlobalSettings is instantiated by the framework when an application starts, to let you perform specific tasks at start-up or shut-down.
How to use it: create a Global.java class in your Java application and override the methods you want.
| Constructor Summary | |
|---|---|
GlobalSettings()
|
|
| Method Summary | |
|---|---|
void |
beforeStart(Application app)
Executed before any plugin - you can set-up your database schema here, for instance. |
Result |
onBadRequest(Http.RequestHeader request,
java.lang.String error)
Triggered when a resource was requested but not found, the default implementation returns null, so that
the Scala engine handles the onBadRequest. |
Result |
onError(Http.RequestHeader request,
java.lang.Throwable t)
Returns a Result that could be a custom error page. |
Result |
onHandlerNotFound(Http.RequestHeader request)
Triggered when a resource was requested but not found. |
Action |
onRequest(Http.Request request,
java.lang.reflect.Method actionMethod)
Call to create the root Action of a request for a Java application. |
play.api.mvc.Handler |
onRouteRequest(Http.RequestHeader request)
Called when an HTTP request has been received. |
void |
onStart(Application app)
Executed after all plugins, including the database set-up with Evolutions and the EBean wrapper. |
void |
onStop(Application app)
Executed when the application stops. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GlobalSettings()
| Method Detail |
|---|
public void beforeStart(Application app)
public void onStart(Application app)
public void onStop(Application app)
public Result onError(Http.RequestHeader request,
java.lang.Throwable t)
null, so that the Scala engine handles the excepetion and show an error page.
t - is any throwable
public Action onRequest(Http.Request request,
java.lang.reflect.Method actionMethod)
request - The HTTP RequestactionMethod - The action method containing the user code for this Action.
public play.api.mvc.Handler onRouteRequest(Http.RequestHeader request)
request - the HTTP request header as seen by the core framework (the body has not been parsed yet)
public Result onHandlerNotFound(Http.RequestHeader request)
null, so that
the Scala engine handles the onActionNotFound.
request - the HTTP request
public Result onBadRequest(Http.RequestHeader request,
java.lang.String error)
null, so that
the Scala engine handles the onBadRequest.
request - the HTTP request
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||