Class ExampleUploadHandler

All Implemented Interfaces:
Handler, RouterNanoHTTPD.UriResponder

public class ExampleUploadHandler extends BaseHandler
Default file upload handler for 'web/html/files/add.html' templates.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • ExampleUploadHandler

      public ExampleUploadHandler(String entity)
    • ExampleUploadHandler

      public ExampleUploadHandler(String entity, String errMsg)
  • Method Details

    • saveData

      public HandlerResponse saveData(BeetRootHTTPSession session) throws Exception
      Description copied from class: BaseHandler
      Save data to DB. Override for add handlers.
      Overrides:
      saveData in class BaseHandler
      Parameters:
      session - HTTP session
      Returns:
      response or null, null means success, response's status must be checked and must hold the id of the saved record!
      Throws:
      Exception - exception
    • getResource

      public String getResource()
      Description copied from class: BaseHandler
      Get web resource file as it lies on the file system relatively to the started server process.
      Specified by:
      getResource in interface Handler
      Specified by:
      getResource in class BaseHandler
      Returns:
      web resource
    • getRedirectHandler

      public Class<?> getRedirectHandler()
      Description copied from class: BaseHandler
      Overwrite to get the right re-route/redirect index handler after modifying data. It must be of the same entity as the last executing handler!
      Overrides:
      getRedirectHandler in class BaseHandler
      Returns:
      redirect index handler
    • render

      public void render(BeetRootHTTPSession session)
      Description copied from class: BaseHandler
      Overwrite to set your template variables. Only use the pure names without bracket-limiters and $-sign; e.g., In template '{$name}' -> 'name' as variable. Example: setVar("name", "Gandalf").
      Overrides:
      render in class BaseHandler
      Parameters:
      session - HTTP session