Interface SimpleWebsiteInterface


  • public interface SimpleWebsiteInterface
    • Method Summary

      Modifier and Type Method Description
      Pair<java.lang.Integer,​java.lang.String> handleRequest​(com.sun.net.httpserver.HttpExchange HTTP_EXCHANGE, java.lang.String[] PATH_VALUES, java.util.HashMap<java.lang.String,​java.lang.String> GET_VALUES, java.util.HashMap<java.lang.String,​java.lang.String> X_WWW_FORM_URLENCODED, java.lang.String RAW, java.util.List<org.apache.commons.fileupload.FileItem> FILES, java.lang.Object JSON_OBJECT)
      The web request handle function is called then somebody calls the path from the WebServerRegistration.
    • Method Detail

      • handleRequest

        Pair<java.lang.Integer,​java.lang.String> handleRequest​(com.sun.net.httpserver.HttpExchange HTTP_EXCHANGE,
                                                                     java.lang.String[] PATH_VALUES,
                                                                     java.util.HashMap<java.lang.String,​java.lang.String> GET_VALUES,
                                                                     java.util.HashMap<java.lang.String,​java.lang.String> X_WWW_FORM_URLENCODED,
                                                                     java.lang.String RAW,
                                                                     java.util.List<org.apache.commons.fileupload.FileItem> FILES,
                                                                     java.lang.Object JSON_OBJECT)
        The web request handle function is called then somebody calls the path from the WebServerRegistration. Please dont forget to register this function with the @WebServerRegistration annotation! If you want anything else than the HttpExchange you need to specify this in the registration!
        Parameters:
        HTTP_EXCHANGE - The http exchange object.
        PATH_VALUES - The path values if enabled. Otherwise NULL.
        GET_VALUES - The get values if enabled. Otherwise NULL.
        X_WWW_FORM_URLENCODED - The X_WWW_FORM_URLENCODED values if enabled. Otherwise NULL.
        RAW - The raw value if enabled. Otherwise NULL.
        FILES - The files if something was uploaded. Otherwise NULL.
        JSON_OBJECT - The json object if the json object is managed by the webserver. Otherwise NULL.
        Returns:
        A pair with the http status code and the string which should be send to the client. If the return is NULL an 404 error will be send. If the code is 0 no answer will be send by the webserver by default. You can still send a response with the HttpExchange object.