All Downloads are FREE. Search and download functionalities are using the official Maven repository.

controllers.FlashController Maven / Gradle / Ivy

There is a newer version: 9.1.0-Beta4
Show newest version
package controllers;

import io.mangoo.routing.Response;
import io.mangoo.routing.bindings.Flash;

public class FlashController {
    private static final String SUCCESS = "success";
    private static final String WARNING = "warning";
    private static final String ERROR = "error";
    private static final String SIMPLE = "simple";

    public Response flash(Flash flash) {
        flash.put(SIMPLE, SIMPLE);
        flash.setError(ERROR);
        flash.setWarning(WARNING);
        flash.setSuccess(SUCCESS);

        return Response.redirect("/flashed");
    }

    public Response flashed() {
        return Response.ok().render();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy