Package com.helger.photon.ajax.executor
Interface IAjaxExecutor
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AjaxExecutorKeepAlive
public interface IAjaxExecutor extends Serializable
Base interface for a single AJAX function handler.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidhandleRequest(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, com.helger.photon.app.PhotonUnifiedResponse aAjaxResponse)Called to handle a specific request.default voidinitExecution(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)Initialization method that is called before the main execution is called.default voidregisterExternalResources()Registers all external resources (CSS or JS files) needed by controls potentially spawned by an AJAX request of this handler.
-
-
-
Method Detail
-
initExecution
default void initExecution(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Initialization method that is called before the main execution is called. This can e.g be used to determine the last modification date time.- Parameters:
aRequestScope- The request scope to be used, to extract parameters. Nevernull.
-
registerExternalResources
default void registerExternalResources()
Registers all external resources (CSS or JS files) needed by controls potentially spawned by an AJAX request of this handler. This method is called BEFOREhandleRequest(IRequestWebScopeWithoutResponse, PhotonUnifiedResponse)is invoked!
-
handleRequest
void handleRequest(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull com.helger.photon.app.PhotonUnifiedResponse aAjaxResponse) throws Exception
Called to handle a specific request. The implementation of this method usually performs a server side task and fills the provided response object with e.g. binary data to download or HTML content to be evaluated by the calling HTML page. If this Ajax executor only executes something but delivers no result, at least the HTTP status 204 (No content) should be returned.- Parameters:
aRequestScope- the request scope values to be used. Nevernull.aAjaxResponse- The response object to be filled. Nevernull.- Throws:
Exception- Any exception if an error occurs.
-
-