public abstract class BaseController extends Object implements juzu.request.RequestLifeCycle
Constructor and Description |
---|
BaseController() |
Modifier and Type | Method and Description |
---|---|
void |
beginRequest(juzu.request.RequestContext requestContext) |
void |
endRequest(juzu.request.RequestContext requestContext) |
Context |
getContext()
Getter for the field
context . |
Flash |
getFlash()
Getter for the field
flash . |
CurrentUser |
getUser()
Getter for the field
user . |
protected juzu.Response.Content |
makeResponse(juzu.Response.Content content)
makeResponse.
|
protected juzu.Response.Content |
makeResponse(juzu.template.Template.Builder builder)
makeResponse.
|
protected juzu.Response.Content |
makeResponse(juzu.template.Template template)
makeResponse.
|
protected void |
render(juzu.template.Template.Builder builder)
render.
|
protected void |
render(juzu.template.Template template)
render.
|
void |
setContext(Context context)
Setter for the field
context . |
void |
setFlash(Flash flash)
Setter for the field
flash . |
void |
setUser(CurrentUser user)
Setter for the field
user . |
public void setFlash(Flash flash)
Setter for the field flash
.
flash
- a Flash
object.public CurrentUser getUser()
Getter for the field user
.
CurrentUser
object.public void setUser(CurrentUser user)
Setter for the field user
.
user
- a CurrentUser
object.public void setContext(Context context)
Setter for the field context
.
context
- a Context
object.protected void render(juzu.template.Template template)
render.
template
- a Template
object.protected void render(juzu.template.Template.Builder builder)
render.
builder
- a Template.Builder
object.protected juzu.Response.Content makeResponse(juzu.template.Template template)
makeResponse.
template
- a Template
object.Response.Content
object.protected juzu.Response.Content makeResponse(juzu.template.Template.Builder builder)
makeResponse.
builder
- a Template.Builder
object.Response.Content
object.protected juzu.Response.Content makeResponse(juzu.Response.Content content)
makeResponse.
content
- a Response.Content
object.Response.Content
object.public void beginRequest(juzu.request.RequestContext requestContext)
Signals to the controller that a request begins. During the invocation of this method, if a Response
is set on the request context, the request will be considered as terminated.
When this method throws a runtime exception, a Response.Error
response will be set on the request
context, thus terminating the request.
beginRequest
in interface juzu.request.RequestLifeCycle
public void endRequest(juzu.request.RequestContext requestContext)
Signals to the controller that a request ends. During the invocation of this method, the response set during
the dispatch of the request is available via the RequestContext.getResponse()
method, this
method is free to override it and provide a new response instead.
When this method throws a runtime exception, a Response.Error
response will be set on the request
requestContext, thus terminating the request.
endRequest
in interface juzu.request.RequestLifeCycle
Copyright © 2011–2016 eXo Platform SAS. All rights reserved.