There are several handler types from which you can inherit. All handlers are generally stateless; the following main methods are called in a stateless context, and you should store variables in the user session if they are needed in another method, and remove them from the session after use, unless you want them to be stored in the persisted user session when the server exits:
HandlerResponse readData(BeetRootHTTPSession session, int id)
- Used by View, Add, Edit and Index handlers
HandlerResponse saveData(BeetRootHTTPSession session)
- Used by Add handler
HandlerResponse updateData(BeetRootHTTPSession session, int id)
- Used by Edit handler
HandlerResponse deleteData(BeetRootHTTPSession session, int id)
- Used by Delete handler
The base handler (base for each handler) calls many methods so that you can customize the behavior of a handler in different ways. Class attributes can be used in some of these methods, and between these calls the handler maintains its state. To know which methods are in a stateful context, examine the BaseHandler.
The default handler to list entity objects, a subclass is generated by PLANT for an entity.
The default handler to view an entity object, a subclass is generated by PLANT for an entity.
The default handler to create an entity object, a subclass is generated by PLANT for an entity.
The default handler to edit an entity object, a subclass is generated by PLANT for an entity.
The default handler to delete an entity object, a subclass is generated by PLANT for an entity.
This handler can be used if a direct HTTP response without a HTML template should be delivered, e.g., when delivering a JSON output. This HTTP response is then attached to a HandlerResponse
Example - readData
-method answer:
...
final Response liveSearchResponse = Response.newFixedLengthResponse(getStatus(), "application/json", jsonString);
return new HandlerResponse(HandlerResponse.STATE_OK, liveSearchResponse);
Note: Available since the release 3.0.1.
This handler can be used if there is no entity shown on a page and therefore has no columns.cfg
. The current page is refreshed after this handler is executed.
This handler can be used if no page is displayed at all. The current page is refreshed after this handler is executed. No columns.cfg
is read.
This handler can be used if no page is displayed at all. The current page is refreshed after this handler is executed.
The same as the handler above, but instead refreshing the current page after this handler is executed, a specific given route is followed.
Click here to go to the main page.